Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
74727b9
bpo-44347: [doc] clarify meaning of shutil.copytree's dirs_exist_ok …
jdevries3133 Jun 9, 2021
0fa96d1
bpo-44347: [doc] clarify shutil.copytree dirs_exist_ok kwarg
jdevries3133 Jun 10, 2021
318a99c
Merge branch 'main' of github.com:python/cpython into bpo-44347
jdevries3133 Jun 10, 2021
9b262b8
bpo-44347: [doc|fix]: add NEWS.d entry, remove use of default context
jdevries3133 Jun 10, 2021
952dbf1
Merge branch 'main' of github.com:python/cpython into bpo-44347
jdevries3133 Jun 10, 2021
e365e52
bpo-44347: [doc] better document argument shutil.copytree(dirs_exist_…
jdevries3133 Jun 11, 2021
eb3ee6f
Merge branch 'main' of github.com:python/cpython into bpo-44347
jdevries3133 Jun 11, 2021
d340c87
bpo-44347: [doc|fix]: add missed updated docstring from previous commit
jdevries3133 Jun 11, 2021
dd2f5c3
bpo-44381: Windows build now allows enabling control flow guard (GH-2…
zooba Jun 11, 2021
d8837d8
bpo-40128: Fix IDLE autocomplete on macOS (GH-26672)
thsubaku9 Jun 11, 2021
869f2fa
bpo-44339: Fix math.pow corner case to comply with IEEE 754 (GH-26606)
mdickinson Jun 12, 2021
29584b7
bpo-43475: Fix the Python implementation of hash of Decimal NaN (GH-2…
serhiy-storchaka Jun 12, 2021
b63a793
Add more const modifiers. (GH-26691)
serhiy-storchaka Jun 12, 2021
feca673
bpo-44376 - reduce pow() overhead for small exponents (GH-26662)
tim-one Jun 12, 2021
b1e8a39
bpo-44396: Update multi-line-start location when reallocating tokeniz…
pablogsal Jun 12, 2021
732ecab
bpo-44389: Remove duplicate SSL_OP_NO_TLSv1_2 flag (GH-26680)
Jun 12, 2021
2a93215
bpo-43425: Update test_c_parser not to use TempdirManager (GH-26693)
corona10 Jun 12, 2021
50aee65
Fix typos in multiple files (GH-26689)
enjoy-binbin Jun 13, 2021
6966890
Fix a potential reference-counting bug in long_pow (GH-26690)
mdickinson Jun 13, 2021
d1a2233
bpo-44389: Fix deprecation of OP_NO_TLSv1_3 (GH-26700)
tiran Jun 13, 2021
67d241b
bpo-44310: Note that lru_cache keep references to both arguments and…
rhettinger Jun 14, 2021
0208b06
bpo-44338: Port LOAD_GLOBAL to PEP 659 adaptive interpreter (GH-26638)
markshannon Jun 14, 2021
ad667a2
Remove accidentally duplicated STAT_INC (GH-26718)
markshannon Jun 14, 2021
6109bfa
bpo-38291: Remove mention of typing.io and typing.re again (GH-26113)
srittau Jun 14, 2021
101dc7e
Fix typo in lnotab_notes.txt (GH-26711)
P403n1x87 Jun 14, 2021
ed3d0b5
bpo-44409: Fix error location in tokenizer errors that happen during …
pablogsal Jun 14, 2021
44d2ad8
Fix a typo in _make_class_unpicklable() docstring (GH-26729)
akulakov Jun 15, 2021
77b67cb
Add extra stats for attribute misses (GH-26732)
markshannon Jun 15, 2021
1628fb8
bpo-42064: Move sqlite3 types to global state (GH-26537)
Jun 15, 2021
c60a9c6
bpo-42972: _thread.RLock implements the GH protocol (GH-26734)
vstinner Jun 15, 2021
1d63579
bpo-44422: Fix threading.enumerate() reentrant call (GH-26727)
vstinner Jun 15, 2021
3e45844
[Enum] improve test, add andrei kulakov to ACKS (GH-26726)
ethanfurman Jun 15, 2021
3e2e824
bpo-43475: Add what's new entry for NaN hash changes (GH-26725)
mdickinson Jun 15, 2021
fc3ca19
bpo-43693: Eliminate unused "fast locals". (gh-26587)
ericsnowcurrently Jun 15, 2021
949a2b7
bpo-44342: [Enum] sync current docs to 3.10 (GH-26750)
ethanfurman Jun 16, 2021
b7f3aca
bpo-43795: Don't list private names in the limited API (GH-26740)
encukou Jun 16, 2021
8fc6dd3
bpo-44422: threading.Thread reuses the _delete() method (GH-26741)
vstinner Jun 16, 2021
66eab7a
bpo-38211: Clean up type_init() (GH-16257)
sir-sigurd Jun 16, 2021
e78f506
bpo-44392: Add Py_GenericAlias to C API docs (GH-26724)
Fidget-Spinner Jun 16, 2021
66c976d
bpo-44426: Use of 'complex' as a C variable name confuses Sphinx; cha…
mdickinson Jun 16, 2021
439482a
bpo-44389: Fix typo in ssl deprecation warning message (GH-26754)
j178 Jun 17, 2021
76bed3a
bpo-43908: Make heap types converted during 3.10 alpha immutable (GH-…
Jun 17, 2021
f446866
Do not clear globals or builtins when calling clear() on a frame obje…
markshannon Jun 17, 2021
3010391
bpo-43024: improve signature (in help, etc) for functions taking sent…
iritkatriel Jun 17, 2021
6e231c0
bpo-44310: Add a FAQ entry for caching method calls (GH-26731)
rhettinger Jun 17, 2021
9ad9fd7
bpo-44032: Move pointer to code object from frame-object to frame spe…
markshannon Jun 18, 2021
95aa9d6
Reorganize the pattern matching suite (GH-26661)
brandtbucher Jun 18, 2021
d808829
bpo-44451: Reset DeprecationWarning filters in test_importlib.test_en…
hroncok Jun 18, 2021
f3dd96a
bpo-43945: [Enum] reduce scope of new format() behavior (GH-26752)
ethanfurman Jun 18, 2021
d4b87bc
Add a note about NameError/AttributeError suggestions with custom err…
pablogsal Jun 18, 2021
32fd669
Remove dubious suggestion (GH-26789)
rhettinger Jun 19, 2021
df719d4
bpo-38820: Test with OpenSSL 3.0.0-beta1 (GH-26769)
tiran Jun 19, 2021
0cf3409
bpo-43298: Improved error message when building without the Windows S…
zooba Jun 19, 2021
07f631d
bpo-44426: Fix use of the C keyword 'default' as a variable name (GH-…
mdickinson Jun 19, 2021
f879593
Merge remote-tracking branch 'upstream/main' into pr_26643
terryjreedy Jun 19, 2021
d035783
commit suggested change from @terryjreedy
jdevries3133 Jun 20, 2021
a1f767c
commit suggested change from @terryjreedy
jdevries3133 Jun 20, 2021
7151b46
commit suggested change from @terryjreedy
jdevries3133 Jun 20, 2021
a0a46be
commit suggested change from @terryjreedy
jdevries3133 Jun 20, 2021
e02e998
bpo-38291: DeprecationWarning when importing typing.{io,re} (#26719)
srittau Jun 19, 2021
82ae9d6
bpo-44347: fix spelling
jdevries3133 Jun 20, 2021
568c773
Merge remote-tracking branch 'upstream/main' into pr_26643
terryjreedy Jun 20, 2021
b2d7cc0
bpo-44347: add note to further clarify edge case
jdevries3133 Jun 21, 2021
a07b324
bpo-44347: (small fix) remove redundant line from example
jdevries3133 Jun 21, 2021
48f30ee
bpo-44347: highlight relationship to os.makedirs
jdevries3133 Jun 21, 2021
5b8366a
small rewording fix
jdevries3133 Jul 1, 2021
60a0eb6
Merge branch 'main' of github.com:python/cpython into bpo-44347
jdevries3133 Apr 8, 2022
8303dc5
revise old changes
jdevries3133 Apr 8, 2022
c169b1d
apply @JelleZijlstra's feedback
jdevries3133 Apr 9, 2022
ac3f837
update docstring
jdevries3133 Apr 10, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
bpo-44389: Fix deprecation of OP_NO_TLSv1_3 (GH-26700)
Signed-off-by: Christian Heimes <christian@python.org>
  • Loading branch information
tiran authored and jdevries3133 committed Jun 19, 2021
commit d1a223332ee74d10ef96826ecfd5bff3267b2326
64 changes: 56 additions & 8 deletions Lib/test/test_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,54 @@ def test_timeout(self):
with test_wrap_socket(s) as ss:
self.assertEqual(timeout, ss.gettimeout())

def test_openssl111_deprecations(self):
options = [
ssl.OP_NO_TLSv1,
ssl.OP_NO_TLSv1_1,
ssl.OP_NO_TLSv1_2,
ssl.OP_NO_TLSv1_3
]
protocols = [
ssl.PROTOCOL_TLSv1,
ssl.PROTOCOL_TLSv1_1,
ssl.PROTOCOL_TLSv1_2,
ssl.PROTOCOL_TLS
]
versions = [
ssl.TLSVersion.SSLv3,
ssl.TLSVersion.TLSv1,
ssl.TLSVersion.TLSv1_1,
]

for option in options:
with self.subTest(option=option):
ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
with self.assertWarns(DeprecationWarning) as cm:
ctx.options |= option
self.assertEqual(
'ssl.OP_NO_SSL*/ssl.SSL_NO_TLS* options are deprecated',
str(cm.warning)
)

for protocol in protocols:
with self.subTest(protocol=protocol):
with self.assertWarns(DeprecationWarning) as cm:
ssl.SSLContext(protocol)
self.assertEqual(
f'{protocol!r} is deprecated',
str(cm.warning)
)

for version in versions:
with self.subTest(version=version):
ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
with self.assertWarns(DeprecationWarning) as cm:
ctx.minimum_version = version
self.assertEqual(
f'ssl.{version!r} is deprecated',
str(cm.warning)
)

@ignore_deprecation
def test_errors_sslwrap(self):
sock = socket.socket()
Expand Down Expand Up @@ -3067,7 +3115,7 @@ def test_dual_rsa_ecc(self):
client_context.load_verify_locations(SIGNING_CA)
# TODO: fix TLSv1.3 once SSLContext can restrict signature
# algorithms.
client_context.options |= ssl.OP_NO_TLSv1_3
client_context.maximum_version = ssl.TLSVersion.TLSv1_2
# only ECDSA certs
client_context.set_ciphers('ECDHE:ECDSA:!NULL:!aRSA')
hostname = SIGNED_CERTFILE_ECC_HOSTNAME
Expand Down Expand Up @@ -3806,7 +3854,7 @@ def test_do_handshake_enotconn(self):
def test_no_shared_ciphers(self):
client_context, server_context, hostname = testing_context()
# OpenSSL enables all TLS 1.3 ciphers, enforce TLS 1.2 for test
client_context.options |= ssl.OP_NO_TLSv1_3
client_context.maximum_version = ssl.TLSVersion.TLSv1_2
# Force different suites on client and server
client_context.set_ciphers("AES128")
server_context.set_ciphers("AES256")
Expand Down Expand Up @@ -4021,10 +4069,10 @@ def test_dh_params(self):
# Check we can get a connection with ephemeral Diffie-Hellman
client_context, server_context, hostname = testing_context()
# test scenario needs TLS <= 1.2
client_context.options |= ssl.OP_NO_TLSv1_3
client_context.maximum_version = ssl.TLSVersion.TLSv1_2
server_context.load_dh_params(DHFILE)
server_context.set_ciphers("kEDH")
server_context.options |= ssl.OP_NO_TLSv1_3
server_context.maximum_version = ssl.TLSVersion.TLSv1_2
stats = server_params_test(client_context, server_context,
chatty=True, connectionchatty=True,
sni_name=hostname)
Expand Down Expand Up @@ -4270,7 +4318,7 @@ def test_sendfile(self):
def test_session(self):
client_context, server_context, hostname = testing_context()
# TODO: sessions aren't compatible with TLSv1.3 yet
client_context.options |= ssl.OP_NO_TLSv1_3
client_context.maximum_version = ssl.TLSVersion.TLSv1_2

# first connection without session
stats = server_params_test(client_context, server_context,
Expand Down Expand Up @@ -4329,8 +4377,8 @@ def test_session_handling(self):
client_context2, _, _ = testing_context()

# TODO: session reuse does not work with TLSv1.3
client_context.options |= ssl.OP_NO_TLSv1_3
client_context2.options |= ssl.OP_NO_TLSv1_3
client_context.maximum_version = ssl.TLSVersion.TLSv1_2
client_context2.maximum_version = ssl.TLSVersion.TLSv1_2

server = ThreadedEchoServer(context=server_context, chatty=False)
with server:
Expand Down Expand Up @@ -4754,7 +4802,7 @@ def msg_cb(conn, direction, version, content_type, msg_type, data):

def test_msg_callback_tls12(self):
client_context, server_context, hostname = testing_context()
client_context.options |= ssl.OP_NO_TLSv1_3
client_context.maximum_version = ssl.TLSVersion.TLSv1_2

msg = []

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix deprecation of :data:`ssl.OP_NO_TLSv1_3`
2 changes: 1 addition & 1 deletion Modules/_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -3587,7 +3587,7 @@ set_options(PySSLContext *self, PyObject *arg, void *c)
long new_opts, opts, set, clear;
long opt_no = (
SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 |
SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2
SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2 | SSL_OP_NO_TLSv1_3
);

if (!PyArg_Parse(arg, "l", &new_opts))
Expand Down