duanmen1887 2016-07-14 13:11 采纳率: 0%
浏览 3517

cURL错误35:gnutls_handshake()失败

我在使用CURL通过SSL请求URI的PHP组件中遇到了以下错误:

cURL error 35: gnutls_handshake() failed: A TLS packet with unexpected length was received.

此错误在travis-ci.org环境中发生,但在我们的任何测试环境中均没有发生。 请参阅travis-ci版本144663700。 我发现在Travis worker中运行的PHP版本在“ Ubuntu 12.04.5 LTS”上再次被编译为“ GnuTLS / 2.12.14”,或者在“ Ubuntu 14.04.3 LTS”上被编译为“ GnuTLS / 2.12.23”。 在我们的开发环境中,在Debian(各种版本)上我们使用针对“ OpenSSL / 1.0.1t”编译的标准软件包。 因此,我假设问题与“ GnuTLS / 2.12.14”或“ GnuTLS / 2.12.23”或与它们一起被编译的参数有关。 我尝试使用CURL常量CURLOPT_SSLVERSION限制SSL版本,但这不能解决问题。 根据www.ssllabs.com,有问题的主机api.reporting.cloud支持TLS 1.2,TLS 1.1和TLS 1.0。 有人对我有任何提示或指示吗?

  • 写回答

3条回答 默认 最新

  • duanmeng3573 2016-07-15 10:25
    关注

    I found the solution to the problem in this mailing list:

    The server doesn't like something in the TLS 1.2 support of gnutls 2.12 since if you disable it, it seems to work. The same server works with gnutls 3.2 and the only difference in the client hello of the two versions is that gnutls 3.2 has more features enabled.

    I am using (required to use) "gnutls-cli (GnuTLS) 2.12.23".

    The following returns the aforementioned error:

    gnutls-cli --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2" api.reporting.cloud
    

    Yet, forcing "TLS 1.1" or "TLS 1.0", returns as expected:

    gnutls-cli --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" api.reporting.cloud
    gnutls-cli --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" api.reporting.cloud
    

    The next step is to make this setting from PHP via CURL (in specific case of faulty library version).

    评论

报告相同问题?

悬赏问题

  • ¥15 win11家庭中文版安装docker遇到Hyper-V启用失败解决办法整理
  • ¥15 gradio的web端页面格式不对的问题
  • ¥15 求大家看看Nonce如何配置
  • ¥15 Matlab怎么求解含参的二重积分?
  • ¥15 苹果手机突然连不上wifi了?
  • ¥15 cgictest.cgi文件无法访问
  • ¥20 删除和修改功能无法调用
  • ¥15 kafka topic 所有分副本数修改
  • ¥15 小程序中fit格式等运动数据文件怎样实现可视化?(包含心率信息))
  • ¥15 如何利用mmdetection3d中的get_flops.py文件计算fcos3d方法的flops?