php - cURL SSL Certificate with Sessions -
i'm trying access ssl website (using curl sessions) have problem ssl certificates.
here's curl ssl settings:
curl_setopt($ch, curlopt_ssl_verifypeer, 1); curl_setopt($ch, curlopt_ssl_verifyhost, 2); curl_setopt($ch, curlopt_sslkey, dirname(__file__) . '\cacert.pem'); curl_setopt($ch, curlopt_sslcert, dirname(__file__) . '\cacert.pem';
i've downloaded cacert.pem file from: http://curl.haxx.se/ca/
i got error: unable set private key file: 'c:\web\data\localweb\cacert.pem' type pem
try options this:
curlopt_useragent => 'mozilla/5.0 (compatible; googlebot/2.1; +http://www.google.com/bot.html)', curlopt_cookiefile => 'anc.tmp', curlopt_cookiejar => 'anc.tmp', curlopt_followlocation => 1, curlopt_returntransfer => 1, curlopt_ssl_verifyhost => 0, curlopt_ssl_verifypeer => 0, curlopt_timeout => 120
Comments
Post a Comment