PayPal TLS Test URL - PHP curl SSL protocol error -
i'm trying test against new paypal test endpoint: https://tlstest.paypal.com
.
see bottom of page: tls 1.2 , http/1.1 upgrade microsite (verify your...).
i'm using php (5.3.28) , curl (7.30.0 - openssl/0.9.8y - libssh2/1.4.2) on windows server 2008 r2 , iis 7.5:
$ch = curl_init(); curl_setopt($ch, curlopt_url, 'https://tlstest.paypal.com'); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_failonerror, true); curl_setopt($ch, curlopt_sslversion, 6); // curl_sslversion_tlsv1_2 $result = curl_exec($ch); echo 'result = '.$result.'<br>'; echo 'errno = '.curl_errno($ch).'<br>'; echo 'error = '.curl_error($ch).'<br>'; curl_close($ch);
i'm getting error:
35 unknown ssl protocol error in connection tlstest.paypal.com:443
i found this: github - unknown ssl protocol error in says:
openssl must @ 1.0.1 or higher tls 1.2.
is correct..?
my php openssl on version: openssl/0.9.8y
(from phpinfo()
).
if need openssl 1.0.1 or higher use tls 1.2 presumably every server running php lesser openssl version (i'm guessing that's lot!) unable use paypal api's or paypal ipn soon.
how update php openssl version on windows..?
i have working now. seems though @ least openssl/1.0.1i is required tls 1.2.
i upgraded php version 5.6.0, upgraded openssl version 1.0.1.
i needed these:
- use
curl_setopt($ch, curlopt_ssl_verifypeer, true);
verify certificate. defaulttrue
of curl 7.10. - save cacert.pem http://curl.haxx.se/docs/caextract.html locally (in case c:\cert), update php ini you're using reference
cacert.pem
as shown here. using ini file saves having usecurl_setopt($ch, curlopt_cainfo, dirname(__file__) . '\cacert.pem');
in every call.
Comments
Post a Comment