How to pass certificates to a php web service that calls 3rd party webservice requiring the certificate
<p>I have built a php page that accesses a 3rd party API through a url.  My php page runs on a local server running apache. The 3rd party API requires a certificate and username/password which are tied to the certficate. The API calls work if I install the certificate on my local webserver, set the curl options to point to the locally installed certificate and use the user credentials for the certificate (these are in the url).</p>

<pre><code>$curl = curl_init();
curl_setopt($curl,CURLOPT_URL, $url);
curl_setopt($curl,CURLOPT_SSL_VERIFYPEER, true); 
curl_setopt($curl,CURLOPT_SSL_VERIFYHOST,2);
curl_setopt($curl, CURLOPT_CAINFO, $certname);
curl_setopt($curl,CURLOPT_SSLCERT, $certname);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_VERBOSE, 1);
$results = curl_exec ($curl);
curl_close ($curl);
</code></pre>

<p>My problem is that there are many internal users, each with their own certificate for this API installed on client machines. I am not sure how to "pass through" the certificate from the user's browser to my php page and then use it in the curl options.   </p>

<p>Is it possible to pass client certificates installed on client machines through to the 3rd party API? If so, can you point me in the right direction? </p>

<p>Is there a better way to do this? </p>