我当前的 PHP 版本是 5.3。最近我更新了5.2到5.3
我在 google 中搜索过,找不到任何有关 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);
}
?>
我在不同的服务器中使用了相同的代码,该代码工作正常。但这在我自己的服务器上不起作用。请检查下面两个屏幕截图 -
我读到php-paypal-error: 14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure但没有得到任何确切的解决方案。请检查并告诉我。
谢谢。
最佳答案
根据SSLLabs该服务器仅支持 TLS 1.2,即不支持 TLS 1.1、TLS 1.0 或 SSL 3.0。
My Current PHP version is 5.3. Recently I have updated it 5.2 to 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。
关于php - PayPal IPN OPENSSL 错误 :14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35030756/