问题
I am getting this error when connecting the PayPal (NVP) API; CURL Request failed: SSL connect error(35)
This means that I can't connect because I am probably using SSL3, how can I fix this issue as I can't go live without testing.. Do I have to change my server or can I fix it in the CURL request?
回答1:
I have the workaround solution which you facing now(i too facing the problem from last week with sandbox environment) now you should try something like in your curl call
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSLVERSION, 6); //6 is for TLSV1.2
DETAILS
CURLOPT_SSLVERSION One of CURL_SSLVERSION_DEFAULT (0), CURL_SSLVERSION_TLSv1 (1), CURL_SSLVERSION_SSLv2 (2), CURL_SSLVERSION_SSLv3 (3), CURL_SSLVERSION_TLSv1_0 (4), CURL_SSLVERSION_TLSv1_1 (5) or CURL_SSLVERSION_TLSv1_2 (6)
.
Note: Your best bet is to not set this and let it use the default. Setting it to 2 or 3 is very dangerous given the known vulnerabilities in SSLv2 and SSLv3.
CREDITS: http://php.net/manual/en/function.curl-setopt.php
Hope it helps to someone.
回答2:
We also faced the same issue, and we fixed this issue by setup the SSL to our server and created ca-certificate and then added ca-certification path in our curl call like the following example.
CURLOPT_SSL_VERIFYPEER => true,
CURLOPT_SSL_VERIFYHOST => 2,
CURLOPT_CAINFO =>'cert.pem',
NOTE: Please check your curl version and update it to latest one.
Server admin people may aware of this, like how to setup SSL as well as how to obtain the ca certificate.
ALL THE BEST,
回答3:
curl_setopt($s, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1);
来源:https://stackoverflow.com/questions/34932410/paypal-nvp-error-curl-request-failed-ssl-connect-error-35