当我试图用curl(或libcurl)连接到任何服务器(如google.com)时,我得到了错误信息:
curl: (35) error:1408F10B:SSL routines:ssl3_get_record:错误版本号
冗长的输出:
$ curl www.google.com --verbose
* Rebuilt URL to: www.google.com/
* Uses proxy env variable no_proxy == 'localhost,127.0.0.1,localaddress,.localdomain.com'
* Uses proxy env variable http_proxy == 'https://proxy.in.tum.de:8080'
* Trying 131.159.0.2...
* TCP_NODELAY set
* Connected to proxy.in.tum.de (131.159.0.2) port 8080 (#0)
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: none
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* error:1408F10B:SSL routines:ssl3_get_record:wrong version number
* Closing connection 0
curl: (35) error:1408F10B:SSL routines:ssl3_get_record:wrong version number'
由于某些原因,curl似乎使用了TLSv1.3,即使我用命令-tlsv1.2强制它使用TLSv1.2(它仍然会打印TLSv1.3(OUT),..."; 我正在使用最新版本的Curl和OpenSSL:
$ curl -V
curl 7.61.0-DEV (x86_64-pc-linux-gnu) libcurl/7.61.0-DEV OpenSSL/1.1.1 zlib/1.2.8
Release-Date: [unreleased]
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP UnixSockets HTTPS-proxy
我想这是一个与我安装的程序有关的问题。 谁能给我解释一下这个错误信息是什么意思?
- 使用代理环境变量 http_proxy == 'https://proxy.in.tum.de:8080'; ^^^^^
https://
是错误的,它应该是http://
。代理本身应该通过HTTP访问,而不是HTTPS,尽管目标URL是HTTPS。然而,代理将正确处理HTTPS连接并保持端到端的加密。请参阅HTTP CONNECT方法了解如何做的细节。