curl: (35) エラー:1408F10B:SSL ルーチン:ssl3_get_record:バージョン番号が間違っています 質問する

curl: (35) エラー:1408F10B:SSL ルーチン:ssl3_get_record:バージョン番号が間違っています 質問する

curl (または libcurl) を使用して任意のサーバー (例: google.com) に接続しようとすると、次のエラー メッセージが表示されます。

curl: (35) エラー:1408F10B:SSL ルーチン: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'  

何らかの理由で、--tlsv1.2 コマンドで TLSv1.2 を使用するように強制しても、curl は TLSv1.3 を使用するようです (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  

これはプログラムのインストールに関連した問題だと思います。このエラー メッセージの意味を誰か説明してもらえますか?

ベストアンサー1

* Uses proxy env variable http_proxy == 'https://proxy.in.tum.de:8080'   
                                         ^^^^^

https://間違っていますhttp://。 のはずです。ターゲット URL が HTTPS であっても、プロキシ自体は HTTPS ではなく HTTP でアクセスする必要があります。プロキシは HTTPS 接続を適切に処理し、エンドツーエンドの暗号化を維持します。HTTP CONNECT メソッド詳細については、こちらをご覧ください。

おすすめ記事