質問

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