This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: SSLContext.set_npn_protocols broken in Python 3.10, tries to call non-existing _set_npn_protocols
Type: compile error Stage:
Components: SSL Versions: Python 3.10
Status: open Resolution:
Dependencies: Superseder:
Assigned To: christian.heimes Nosy List: christian.heimes, diabonas
Priority: normal Keywords:

Created on 2021-12-13 17:18 by diabonas, last changed 2022-04-11 14:59 by admin.

Messages (1)
msg408466 - (view) Author: Jonas Witschel (diabonas) Date: 2021-12-13 17:18
Consider the following minimal example:

import ssl
context = ssl.create_default_context()
context.set_npn_protocols(['http/1.1', 'spdy/2'])

In Python 3.10, it fails with the following error:

AttributeError: 'SSLContext' object has no attribute '_set_npn_protocols'. Did you mean: 'set_npn_protocols'?

This is because bpo-43669 ( removed _set_npn_protocols, while it is still used by SSLContext.set_npn_protocols:

Note that the function is already deprecated in Python 3.10 and throws a

DeprecationWarning: ssl NPN is deprecated, use ALPN instead

but should still probably continue working for now.
Date User Action Args
2022-04-11 14:59:53adminsetgithub: 90225
2021-12-13 17:18:24diabonascreate