Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit c312ee3

Browse files
authored
Use TLSv1.2 for fake servers in tests (#8208)
Some Linux distros have begun disabling TLSv1.0 and TLSv1.1 by default for security reasons, for example in Fedora 33 onwards: https://fedoraproject.org/wiki/Changes/StrongCryptoSettings2 Use TLSv1.2 for the fake TLS servers created in the test suite, to avoid failures due to OpenSSL disallowing TLSv1.0: <twisted.python.failure.Failure OpenSSL.SSL.Error: [('SSL routines', 'ssl_choose_client_version', 'unsupported protocol')]> Signed-off-by: Dan Callaghan <[email protected]>
1 parent 95d869c commit c312ee3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

changelog.d/8208.misc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix tests on distros which disable TLSv1.0. Contributed by @danc86.

tests/http/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def __init__(self, sanlist):
145145
self._cert_file = create_test_cert_file(sanlist)
146146

147147
def serverConnectionForTLS(self, tlsProtocol):
148-
ctx = SSL.Context(SSL.TLSv1_METHOD)
148+
ctx = SSL.Context(SSL.SSLv23_METHOD)
149149
ctx.use_certificate_file(self._cert_file)
150150
ctx.use_privatekey_file(get_test_key_file())
151151
return Connection(ctx, None)

0 commit comments

Comments
 (0)