Skip to content

Commit

Permalink
bpo-43998: Fix testing without ssl module (GH-25790)
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Heimes <christian@python.org>
  • Loading branch information
tiran committed May 1, 2021
1 parent 9a42d50 commit a5669b3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Lib/test/test_nntplib.py
Expand Up @@ -368,9 +368,10 @@ class NetworkedNNTP_SSLTests(NetworkedNNTPTests):
# Disabled as the connection will already be encrypted.
test_starttls = None

ssl_context = ssl._create_unverified_context()
ssl_context.set_ciphers("DEFAULT")
ssl_context.maximum_version = ssl.TLSVersion.TLSv1_2
if ssl is not None:
ssl_context = ssl._create_unverified_context()
ssl_context.set_ciphers("DEFAULT")
ssl_context.maximum_version = ssl.TLSVersion.TLSv1_2

#
# Non-networked tests using a local server (or something mocking it).
Expand Down

0 comments on commit a5669b3

Please sign in to comment.