ssl - Certificate Pinning with PHP cURL -


i see there tons of post in so, error:

ssl certificate problem: unable local issuer certificate 

and 1 getting.

all of answer saying download root certificates from:

https://curl.haxx.se/ca/cacert.pem

and setting curlopt_cainfo or setting php.ini's curl.cainfo.

but telling curl trust list of root ca , trusted ca.

from understanding, certificate pinning should ignore these root ca , trust single certificate of particular provider.

what correct way fix error?

    $ch =  curl_init($url);     curl_setopt($ch, curlopt_ssl_verifyhost, 2);     curl_setopt($ch, curlopt_ssl_verifypeer, true);             curl_setopt($ch, curlopt_cainfo, '/etc/httpd/static.gc.apple.com.pem');     curl_setopt($ch, curlopt_capath, '/etc/httpd/');      //curl_setopt($ch, curlopt_pinnedpublickey, "sha256//teyzgg/8dvpuksaescb3tsvlehby6w9q63txhoif0tg=");     $sslcertificate = curl_exec($ch); 

i know libcurl itself, has option "curlopt_pinnedpublickey" absolutely need, php still not supporting it... (it doesn't have such constant in php , have no idea actual value of constant)

basically issue because php installed yum remi didn't compiled curl , openssl support it. have update curl, openssl, compile php source , worked.


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -