Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asyncio: add ssl_object extra info #69301

Closed
vstinner opened this issue Sep 14, 2015 · 8 comments
Closed

asyncio: add ssl_object extra info #69301

vstinner opened this issue Sep 14, 2015 · 8 comments

Comments

@vstinner
Copy link
Member

BPO 25114
Nosy @gvanrossum, @vstinner, @mathieui, @1st1
Files
  • ssl_object.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2015-09-21.16:29:13.518>
    created_at = <Date 2015-09-14.22:00:46.948>
    labels = ['expert-asyncio']
    title = 'asyncio: add ssl_object extra info'
    updated_at = <Date 2015-09-21.20:22:27.657>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2015-09-21.20:22:27.657>
    actor = 'python-dev'
    assignee = 'none'
    closed = True
    closed_date = <Date 2015-09-21.16:29:13.518>
    closer = 'vstinner'
    components = ['asyncio']
    creation = <Date 2015-09-14.22:00:46.948>
    creator = 'vstinner'
    dependencies = []
    files = ['40468']
    hgrepos = []
    issue_num = 25114
    keywords = ['patch', '3.5regression']
    message_count = 8.0
    messages = ['250705', '250706', '250978', '251233', '251236', '251237', '251238', '251251']
    nosy_count = 5.0
    nosy_names = ['gvanrossum', 'vstinner', 'python-dev', 'mathieui', 'yselivanov']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue25114'
    versions = ['Python 3.4', 'Python 3.5', 'Python 3.6']

    @vstinner
    Copy link
    Member Author

    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 bpo-22768.

    My patch adds also unit tests on SSL extra info. We only had poor unit tests on these info.

    @vstinner
    Copy link
    Member Author

    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

    @vstinner
    Copy link
    Member Author

    Guido? Yury? Can you please review attached patch? It looks like a Python 3.5 regression.

    @1st1
    Copy link
    Member

    1st1 commented Sep 21, 2015

    the patch lgtm

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 21, 2015

    New changeset d7859e7e7071 by Victor Stinner in branch '3.4':
    Issue bpo-25114, asyncio: add ssl_object extra info to SSL transports
    https://hg.python.org/cpython/rev/d7859e7e7071

    @Arfrever Arfrever mannequin changed the title asynico: add ssl_object extra info asyncio: add ssl_object extra info Sep 21, 2015
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 21, 2015

    New changeset 2f451651038c by Victor Stinner in branch '3.5':
    Issue bpo-25114: Adjust versionchanged in the doc
    https://hg.python.org/cpython/rev/2f451651038c

    @vstinner
    Copy link
    Member Author

    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.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 21, 2015

    New changeset 32e3a9e46f70 by Victor Stinner in branch '3.4':
    Issue bpo-25114: Fix test_asyncio
    https://hg.python.org/cpython/rev/32e3a9e46f70

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants