You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Debian Sid/Buster: Cannot enable TLS 1.0/1.1 with PROTOCOL_TLS #75634
I read about that, but I don't understand. If I use openssl s_server -port 3333 , I can connect using either one of the three protocols.
Even if that's the new default, is there no way now to get python on Buster/Sid to use OpenSSL in a non-default mode and have it offer all three versions?
Please report this issue to the Debian maintainers. I don't know how Debian has disabled TLS 1.0 and TLS 1.1 for the SSL_METHOD *TLS_method(void). It might not be possible to enable auto-negotiation for old protocols at all.
Debian patched the default for SSL_CTX_set_min_proto_version(). The SSL_CTX_set_min_proto_version() and SSL_CTX_set_max_proto_version() API calls are OpenSSL 1.1.0-only and not available from Python. It is not possible to override the minimum version from Python.
I have pushed the enhancement now. I feel a bit guilty about the last minute push, but I honestly believe it's in our best interesting.
There is a high chance that the new APIs will be required for Debian and other distros in the near future. OpenSSL has deprecated the old API, too. It is likely that OpenSSL 1.2.0 will remove both the options (OP_NO_TLSv1, OP_NO_TLSv1_2, ...) options and version specific protocols (PROTOCOL_TLSv1, PROTOCOL_TLSv1_2, ...).
Christian, ping again: can this be closed? In any case, it would not seem to be a "deferred blocker"; downgrading to "critical". Please close or update, thanks!
The problem no longer affects Python 3.7 and 3.8. It may affects Python 3.6 and 2.7 if Debian to decide to disable TLS 1.0 and 1.1 again. If Debian uses the new OpenSSL 1.1.0 API to disable the protocols, then I have to backport https://bugs.python.org/issue32609 to 2.7 and 3.6.
kroeckx commented on May 24, 2018
kroeckxmannequin
Mannequin
More actions
Note that the version in experimental only supports TLS 1.2 and 1.3 with the default config. It's moved from fixed in the code, to the default config file. I expect to upload that to unstable "soon", at which point people will be affected by this again.
which API are you using to disable TLS 1.0 and 1.1? Is it the old SSL_CTX_set_options() or the new SSL_CTX_set_min/max_proto_version() API?
kroeckx commented on May 24, 2018
kroeckxmannequin
Mannequin
More actions
The effect is the same as calling SSL_CTX_set_min_proto_version().
smartmadre commented on Nov 4, 2018
smartmadremannequin
Mannequin
More actions
FYI, This is how I figured out and fixed the issue on my debian system.
-Run nmap to figure out what ssl version is being used by the server
nmap -p443 -sV --script ssl-enum-ciphers 10.10.10.7
output says TLSv1.0
Python 2.7 is out of supports. 3.6 will reach end of security support soon. More recent Python versions have TLS 1.0 and 1.1 deprecated and contain workarounds for tests.
Activity
AdrianVollmer commentedon Sep 13, 2017
According to the documentation (https://docs.python.org/2/library/ssl.html#ssl.PROTOCOL_TLS), using ssl_version = ssl.PROTOCOL_TLS in a server socket should offer all TLS/SSL versions. However, it only offers TLSv1_2.
I attached a proof of concept.
To connect with s_client:
AlexGaynor commentedon Sep 13, 2017
What operating system are you on?
AdrianVollmer commentedon Sep 13, 2017
Debian buster/sid
tiran commentedon Sep 13, 2017
Debian Buster has patched OpenSSL to disable TLS 1.0 and 1.1 by default,
https://lists.debian.org/debian-devel-announce/2017/08/msg00004.html
AdrianVollmer commentedon Sep 13, 2017
I read about that, but I don't understand. If I use openssl s_server -port 3333 , I can connect using either one of the three protocols.
Even if that's the new default, is there no way now to get python on Buster/Sid to use OpenSSL in a non-default mode and have it offer all three versions?
tiran commentedon Sep 13, 2017
You have to enable the protocols by applying a reverse bitmask to SSLContext.options:
AdrianVollmer commentedon Sep 13, 2017
Doesn't seem to do anything:
tiran commentedon Sep 13, 2017
Please report this issue to the Debian maintainers. I don't know how Debian has disabled TLS 1.0 and TLS 1.1 for the SSL_METHOD *TLS_method(void). It might not be possible to enable auto-negotiation for old protocols at all.
AdrianVollmer commentedon Sep 13, 2017
Okay, thanks for your time!
tiran commentedon Sep 13, 2017
Ah, here we go: https://anonscm.debian.org/viewvc/pkg-openssl/openssl/branches/1.1.0/debian/patches/tls1_2_default.patch
Debian patched the default for SSL_CTX_set_min_proto_version(). The SSL_CTX_set_min_proto_version() and SSL_CTX_set_max_proto_version() API calls are OpenSSL 1.1.0-only and not available from Python. It is not possible to override the minimum version from Python.
[-]ssl.PROTOCOL_TLS only select TLSv1.2[/-][+]Debian Sid/Buster: Cannot enable TLS 1.0/1.1 with PROTOCOL_TLS[/+]15 remaining items
tiran commentedon Feb 27, 2018
Ned,
I have pushed the enhancement now. I feel a bit guilty about the last minute push, but I honestly believe it's in our best interesting.
There is a high chance that the new APIs will be required for Debian and other distros in the near future. OpenSSL has deprecated the old API, too. It is likely that OpenSSL 1.2.0 will remove both the options (OP_NO_TLSv1, OP_NO_TLSv1_2, ...) options and version specific protocols (PROTOCOL_TLSv1, PROTOCOL_TLSv1_2, ...).
ned-deily commentedon Mar 29, 2018
Christian, is there more needed for this issue or can it be closed?
ned-deily commentedon May 1, 2018
Christian, ping. Can we close this?
ned-deily commentedon May 24, 2018
Christian, ping again: can this be closed? In any case, it would not seem to be a "deferred blocker"; downgrading to "critical". Please close or update, thanks!
tiran commentedon May 24, 2018
The problem no longer affects Python 3.7 and 3.8. It may affects Python 3.6 and 2.7 if Debian to decide to disable TLS 1.0 and 1.1 again. If Debian uses the new OpenSSL 1.1.0 API to disable the protocols, then I have to backport https://bugs.python.org/issue32609 to 2.7 and 3.6.
kroeckx commentedon May 24, 2018
Note that the version in experimental only supports TLS 1.2 and 1.3 with the default config. It's moved from fixed in the code, to the default config file. I expect to upload that to unstable "soon", at which point people will be affected by this again.
tiran commentedon May 24, 2018
Thanks Kurt,
which API are you using to disable TLS 1.0 and 1.1? Is it the old SSL_CTX_set_options() or the new SSL_CTX_set_min/max_proto_version() API?
kroeckx commentedon May 24, 2018
The effect is the same as calling SSL_CTX_set_min_proto_version().
smartmadre commentedon Nov 4, 2018
FYI, This is how I figured out and fixed the issue on my debian system.
-Run nmap to figure out what ssl version is being used by the server
nmap -p443 -sV --script ssl-enum-ciphers 10.10.10.7
output says TLSv1.0
test 10.10.10.7 using example in this comment (gets expected error)
psf/requests#606 (comment)
test with openssl binary (gets expected error)
openssl s_client -connect 10.10.10.7:443
fix by editing this value-->MinProtocol = TLSv1.0
in this file--> /etc/ssl/openssl.cnf
rerun tests without error.
Note the outdated server I am connecting to is internal, non-production, not connected to the internet.
tiran commentedon Apr 17, 2021
Python 2.7 is out of supports. 3.6 will reach end of security support soon. More recent Python versions have TLS 1.0 and 1.1 deprecated and contain workarounds for tests.