问题原文
原帖链接 · carlin.scott · CC BY-SA 4.0
I have a Debian Buster server that is unable to establish an HTTPS/SSL connection to several servers unless I force a TLS 1.2 connection using the openssl s_client -tls1_2 command.
The errors from various clients are:
- openssl s_client - "SSL handshake has read 0 bytes"
- wget - "GnuTLS: The TLS connection was non-properly terminated."
- curl - "OpenSSL SSL_connect: SSL_ERROR_SYSCALL"
- dotnet nuget restore - "Received an unexpected EOF or 0 bytes from the transport stream."
openssl.cnf already has MinProtocol = TLSv1.2 by default.
The impacted servers are:
- api.nuget.org
- packages.microsoft.com
- production.cloudflare.docker.com
How do I force my server to use TLS 1.2 when connecting to these domains?
已采纳解答
原帖链接 · carlin.scott · CC BY-SA 4.0
For applications that use OpenSSL, you can set the MinProtocol and MaxProtocol version to TLSv1.2 to force all connections to use TLSv1.2. I know of no way to set this per domain. This is not advisable because some servers only support TLSv1.3, so connections to them will fail.
- Open openssl.cnf:
vi /etc/ssl/openssl.cnf - Scroll to the bottom: Shift-G
- Insert a new line: Shift-O
- Add
MaxProtocol = TLSv1.2
For applications that use GnuTLS, for example apt, you can disable other versions of TLS in the system-wide GnuTLS configuration file, probably /etc/gnutls/config:
[overrides]
disabled-version = tls1.0
disabled-version = tls1.1
disabled-version = tls1.3
See Disabling algorithms and protocols.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
