Reputation: 501
I have a web app that uses authentication with client certificates. I'm trying to hit a web service (URL) available in that app, but I'm confused about how to set the certificate information.
If I hit the URL directly from my browser it works fine.
Is it possible to get the client information from the browser?
Upvotes: 1
Views: 4144
Reputation: 369
If you use Curl you can disable SSL verifyhost and verifypeer
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
Or you can set a valide certificat like this
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_CAINFO, getcwd() . "/CAcerts/BuiltinObjectToken-EquifaxSecureCA.crt");
Both solution work, the first is a bit simpler
Upvotes: 1