Frage

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

War es hilfreich?

Lösung

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);
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top