我正在尝试测试一个新的PayPal测试端点:https://tlstest.paypal.com
请参考此页面底部:TLS 1.2 and HTTP/1.1 Upgrade Microsite (验证您的...)。
我正在使用PHP(5.3.28)和curl(7.30.0-OpenSSL / 0.9.8y-libssh2 / 1.4.2)在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);
我遇到了这个错误:
35 在与 tlstest.paypal.com:443 的连接中未知的 SSL 协议错误
我在这里找到了一个链接:Github - 未知 SSL 协议错误 ,其中有人说:
TLS 1.2 要求 OpenSSL 必须在 1.0.1 或更高版本。
这是正确的吗?
我的 PHP OpenSSL 版本是:OpenSSL/0.9.8y
(来自于 phpinfo()
)。
如果确实需要 OpenSSL 1.0.1 或更高版本才能使用 TLS 1.2,那么预计所有安装了低版本 OpenSSL 的运行 PHP 的服务器(我猜可能会有很多!)将无法使用任何 PayPal API 或 PayPal IPN。
如何在 Windows 上更新我的 PHP OpenSSL 版本?