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.

classification
Title: asyncio: add ssl_object extra info
Type: Stage:
Components: asyncio Versions: Python 3.6, Python 3.4, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: gvanrossum, mathieui, python-dev, vstinner, yselivanov
Priority: normal Keywords: 3.5regression, patch

Created on 2015-09-14 22:00 by vstinner, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
ssl_object.patch vstinner, 2015-09-14 22:00 review
Messages (8)
msg250705 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-09-14 22:00
Attached patch adds the "ssl_object" extra information to SSL sockets. For the legacy SSL implementation, it's a ssl.SSLSocket instance. For the new SSL implementation, it's a ssl.SSLObject instance.

ssl.SSLObject and ssl.SSLSocket have a similar but different API. Both classes provide important methods like getpeercert().

This issue fixes a regressions of Python 3.5 compared to Python 3.4 in asyncio SSL sockets: it's no more possible to get the peer certificate as a binary object (only as text). See the issue #22768.

My patch adds also unit tests on SSL extra info. We only had poor unit tests on these info.
msg250706 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-09-14 22:02
Workaround for Python 3.5.0: force the legacy SSL implementation. For example, monkey patch the asyncio module with:

asyncio.sslproto._is_sslproto_availabe=lambda: False
msg250978 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-09-18 13:16
Guido? Yury? Can you please review attached patch? It looks like a Python 3.5 regression.
msg251233 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2015-09-21 15:23
the patch lgtm
msg251236 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-09-21 16:09
New changeset d7859e7e7071 by Victor Stinner in branch '3.4':
Issue #25114, asyncio: add ssl_object extra info to SSL transports
https://hg.python.org/cpython/rev/d7859e7e7071
msg251237 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-09-21 16:28
New changeset 2f451651038c by Victor Stinner in branch '3.5':
Issue #25114: Adjust versionchanged in the doc
https://hg.python.org/cpython/rev/2f451651038c
msg251238 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-09-21 16:29
I pushed my change to Python 3.4, 3.6 and 3.6 and Github.

The strange thing is the put a different "versionchanged" tag in the doc: version 3.4.4 in the 3.4 branch, version 3.5.1 in the 3.5 and default branches.
msg251251 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-09-21 20:22
New changeset 32e3a9e46f70 by Victor Stinner in branch '3.4':
Issue #25114: Fix test_asyncio
https://hg.python.org/cpython/rev/32e3a9e46f70
History
Date User Action Args
2022-04-11 14:58:21adminsetgithub: 69301
2015-09-23 12:03:14vstinnerlinkissue25214 superseder
2015-09-21 20:22:27python-devsetmessages: + msg251251
2015-09-21 16:29:13vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg251238
2015-09-21 16:28:17python-devsetmessages: + msg251237
2015-09-21 16:18:38Arfreversettitle: asynico: add ssl_object extra info -> asyncio: add ssl_object extra info
2015-09-21 16:09:39python-devsetnosy: + python-dev
messages: + msg251236
2015-09-21 15:23:22yselivanovsetmessages: + msg251233
2015-09-21 07:19:18vstinnersetkeywords: + 3.5regression
2015-09-18 13:16:40vstinnersetmessages: + msg250978
2015-09-14 22:02:11vstinnersetmessages: + msg250706
2015-09-14 22:00:46vstinnercreate