Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

is this set up right?

$
0
0

is this code setup right?

// Get cURL resource
$curl = curl_init();
// Set some options - we are passing in a useragent too here
curl_setopt($curl, CURLOPT_URL, $request_url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl, CURLOPT_VERBOSE, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($curl, CURLOPT_CAINFO,  '/public_html/cert/ca.crt');  //(<--- path to CA bundle)
curl_setopt($curl, CURLOPT_SSLCERT, '/public_html/cert/mycert.pem');  //(<--- path to SSL certificate)
curl_setopt($curl, CURLOPT_SSLKEY, '/public_html/cert/mykey.pem');  //(<--- path to RSA key)
curl_setopt($curl, CURLOPT_SSLCERTPASSWD, 'password');
// Send the request & save response to $resp
$result = curl_exec($curl);
echo curl_error($curl);
// Close request to clear up some resources
curl_close($curl);
 
I keep getting this error when executing this code,
 
unable to use client certificate (no key found or wrong pass phrase?)

Viewing all articles
Browse latest Browse all 13200

Trending Articles