Trouble with authentication in vk.com with zend_oa

2019-07-20 03:07发布

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

1条回答
爷的心禁止访问
2楼-- · 2019-07-20 04:04

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);
查看更多
登录 后发表回答