Jump to content

PHP, cURL and PKI


interrobang

Recommended Posts

I'm trying to use curl to connect to a PKI-required site.

 

For testing purposes, running command line cURL passing in the path to my PKI, its password, and the flag to disable peer validation, I get a successful result.  The target site is a RESTful web service (my work's intranet, I have no public URL to offer)

 

Yet from PHP, I continually get an Internal Server Error returned.

 

At a minimum, I've got this:

 

$ch = curl_init($myurl);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);

curl_setopt($ch, CURLOPT_SSLCERT, "/path/to/my/cert.pem");

curl_setopt($ch, CURLOPT_SSLCERTPASSWD, "mypassword");

 

$result = curl_exec($ch);

curl_close($ch);

 

I have not tried setting the CURLOPT_CAINFO option since I had the VERIFY* options set to 0, and since it worked from the command line without any CA info.

 

I've tried different toggles for various other options to no avail.

 

I've verified from phpinfo() that curl is set up correctly and includes https.

 

Anyone have any ideas?

 

Link to comment
https://forums.phpfreaks.com/topic/185412-php-curl-and-pki/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.