php Paypal 无法连接到 Sandbox 服务器。返回错误 14077410(sslv3 警报握手失败)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/34790912/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 00:13:35  来源:igfitidea点击:

Paypal can not connect to Sandbox server. Return error 14077410 (sslv3 alert handshake failure)

phpsslcurlpaypalsandbox

提问by user3538235

The site that connect sandbox paypal works , until recently

连接沙盒 paypal 的站点工作,直到最近

it can connect will curl

它可以连接会卷曲

but when it send the request at the second time

但是当它第二次发送请求时

it show the error of

它显示的错误

error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure

错误:14077410:SSL 例程:SSL23_GET_SERVER_HELLO:sslv3 警报握手失败

I have tried some reference online and set the SSL SHA-256 cert of it but it return same error. Other suggest switch to TLS at the curl connection but it may not perfered as there are many project I have handled.

我在网上尝试了一些参考并设置了它的 SSL SHA-256 证书,但它返回相同的错误。其他建议在 curl 连接时切换到 TLS,但由于我处理过的项目很多,因此可能不适合。

Are there any suggestion to connect sandbox paypal with SSLv3? Thanks for helping.

是否有任何建议将沙盒 paypal 与 SSLv3 连接?谢谢你的帮助。

enter image description here

在此处输入图片说明

enter image description here

在此处输入图片说明

enter image description here

在此处输入图片说明

采纳答案by 0kay

You'll have to switch the cURL request to use TLS 1.2 in order to use the PayPal sandbox. I'm in the same boat, and there's no way around it, unfortunately. They just activated the change on the sandbox environment a few days ago.

您必须将 cURL 请求切换为使用 TLS 1.2 才能使用 PayPal 沙箱。我在同一条船上,不幸的是,没有办法绕过它。几天前他们刚刚激活了对沙箱环境的更改。

https://devblog.paypal.com/upcoming-security-changes-notice/

https://devblog.paypal.com/upcoming-security-changes-notice/

回答by Matt O

I'll add some extra info on this since the first answer doesn't really cover all of the important points.

我将为此添加一些额外信息,因为第一个答案并未真正涵盖所有要点。

Paypal has started rolling out some upgrades, the sandbox now requires TLS 1.2 for all requests, and production systems will also require this from June 2016 onwards.

Paypal 已开始推出一些升级,沙箱现在要求所有请求都使用 TLS 1.2,从 2016 年 6 月起生产系统也将要求这样做

To support this you will need to:

为了支持这一点,您需要:

  • Ensure your server has OpenSSL 1.0.1 or above (which is when TLS 1.2 support was added).
    openssl versionwill show you your version number.

  • Once you meet that criteria, in your PHP code you can force the SSLVERSIONto TLS 1.2 with the following command:

    curl_setopt($curl, CURLOPT_SSLVERSION, 6);
    
  • 确保您的服务器具有 OpenSSL 1.0.1 或更高版本(即添加 TLS 1.2 支持时)。
    openssl version将显示您的版本号。

  • 满足该条件后,您可以在 PHP 代码中SSLVERSION使用以下命令强制使用TLS 1.2:

    curl_setopt($curl, CURLOPT_SSLVERSION, 6);
    

Or if you want a less hacky solution, it is possible to have the correct SSL version kick in automatically during the handshake, where the client and server compare available ciphers to find a common protocol. You appear to be using PHP + curl, so you'll need PHP 5.5.19+ and curl 7.29+for this to take place.

或者,如果您想要一个不那么笨拙的解决方案,则可以在握手期间自动启动正确的 SSL 版本,客户端和服务器会比较可用的密码以找到通用协议。您似乎在使用 PHP + curl,因此您需要PHP 5.5.19+ 和 curl 7.29+才能执行此操作。

回答by Tapa Save

I have similar problem with error 14077410 and SSL3. I upgrade my PHP server from 5.4 to 7.0 and error disappear.

我有类似的问题,错误 14077410 和 SSL3。我将我的 PHP 服务器从 5.4 升级到 7.0,错误消失了。