Trouble with authentication in vk.com with zend_oauth

Message: Error in HTTP request: Unable to enable crypto on TCP connection oauth.vk.com: make sure the "sslcafile" or "sslcapath" option are properly set for the environment.

Help me please

有帮助吗?

解决方案

You need to use curl as adapter and turn off ssl certificate checks:

$adapter = new \Zend\Http\Client\Adapter\Curl();
$adapter = $adapter->setCurlOption(CURLOPT_SSL_VERIFYHOST, false);
$adapter = $adapter->setCurlOption(CURLOPT_SSL_VERIFYPEER, false);

$config = array(
    'siteUrl'        => 'https://url',
    'consumerKey'    => 'login',
    'consumerSecret' => 'pass'
);
$consumer = new \ZendOAuth\Consumer($config);

/** @var \Zend\Http\Client $httpClient */
$httpClient = $consumer->getHttpClient();
$httpClient->setAdapter($adapter);
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top