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

时间:2016-01-27 07:03:30

标签: php ssl paypal

My Current PHP版本是5.3。最近我更新了5.2到5.3

我在谷歌搜索过我无法找到有关PayPal IPN验证的任何解决方案。

我看到我的phpinfo()启用了OPenSSL,但我仍然收到此错误消息 -

Warning: fsockopen() [function.fsockopen]: SSL operation failed with code 1. OpenSSL Error messages: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure in /home/xxx/public_html/paypal_test/socketopen.php on line 5

Warning: fsockopen() [function.fsockopen]: Failed to enable crypto in /home/xxx/public_html/paypal_test/socketopen.php on line 5

Warning: fsockopen() [function.fsockopen]: unable to connect to ssl://www.sandbox.paypal.com:443 (Unknown error) in /home/xxx/public_html/paypal_test/socketopen.php on line 5
()

我的代码是 -

<?php
$fp = fsockopen ( 'ssl://www.sandbox.paypal.com', "443", $err_num, $err_str, 60);
if (!$fp) {
    echo "$errstr ($errno)<br />\n";
} else {
    $out = "GET / HTTP/1.1\r\n";
    $out .= "Host: www.sandbox.paypal.com\r\n";
    $out .= "Connection: Close\r\n\r\n";
    fwrite($fp, $out);
    while (!feof($fp)) {
        echo fgets($fp, 128);
        echo "<br>";
    }
    fclose($fp);
}
?>

我在不同的服务器上使用了相同的代码,这段代码运行正常。但这不适用于我自己的服务器。请查看以下两个截图 -

实际产量 - enter image description here

我的输出 - enter image description here

我读过php-paypal-error: 14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure但没有得到任何确切的解决方案。请检查并告知我们。

谢谢。

1 个答案:

答案 0 :(得分:5)

根据SSLLabs,此服务器仅支持TLS 1.2,即没有TLS 1.1,TLS 1.0或SSL 3.0。

  

My Current PHP版本是5.3。最近我更新了5.2到5.3

鉴于你使用的是相当旧版本的PHP,你很可能也使用旧版本的OpenSSL。仅在OpenSSL版本1.0.1中添加了对TLS 1.2的必要支持。要找出您正在使用的版本,可以使用

 php -r 'printf("0x%x\n", OPENSSL_VERSION_NUMBER);'

这应该至少返回0x10001000(即版本1.0.1)。以下任何内容都不支持TLS 1.2。

相关问题