php - 连接到 etws.etrade.com 的未知 SSL 协议(protocol)错误 :443

标签 php ssl curl etrade-api

我正在尝试连接到使用 OAuth 的 eTrade API。我正在尝试请求 token 。

我尝试连接的域具有 SSL 证书。

连接使用 TLS 1.2。使用 AES_128_GCM 对连接进行加密和身份验证,并使用 ECDHE_RSA 作为 key 交换机制。

这是我得到的确切错误

捕获到异常 错误代码:1001 错误消息:错误编号:35 错误:连接到 etws.etrade.com 时发生未知 SSL 协议(protocol)错误:443 #0/home/detroitclicks/public_html/etrade/Common/etHttpUtils.class.php(174):etHttpUtils->DoHttpRequest() #1/home/detroitclicks/public_html/etrade/OAuth/etOAuth.class.php(58):etHttpUtils->GetResponse () #2/home/detroitclicks/public_html/etrade/Samples/test_etOAuth.php(54): etOAuth->GetRequestToken() #3 {main} 退出...

我不确定这是否重要,但我在我的一个 php 文件中设置了这个:

    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HEADER, true);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
    curl_setopt($ch, CURLOPT_SSLVERSION, 3);

最佳答案

The connection uses TLS 1.2.   
....
curl_setopt($ch, CURLOPT_SSLVERSION, 3);

TLS 1.2 的要求与带有 CURLOPT_SSLVERSION 的版本 3 (SSL 3.0) 的显式设置之间存在不匹配。只需删除此设置,它就会尽力而为。如果您的本地 SSL 堆栈尚不支持 TLS 1.2,它可能仍会失败。

关于php - 连接到 etws.etrade.com 的未知 SSL 协议(protocol)错误 :443,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26953200/

相关文章:

php - 如何在 PHP Google App Engine 中使用 Composer

php - 通过php或者jquery根据category生成html

ruby - 为什么 Ruby 中的 curl 比命令行 curl 慢?

尽管 HTTP 代码 200,PHP cURL 返回空 header 和正文

javascript - 在 PHP 中使用 javascript 变量

php - wordpress 博客信息 ('template_directory' );使用 Twig 解析为字符串

ssl - 带有 SSL 证书的 Grails 3.3.5

android - HTTPS 证书有时会在 Android WebView 中失败

apache - 管理 Multi-Tenancy 应用程序的 SSL 证书

php - 无法 curl 图像。不知道该怎么办