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: SSL transport does not support set_protocol() #75813

Closed
jlacoline mannequin opened this issue Sep 29, 2017 · 4 comments
Closed

Asyncio: SSL transport does not support set_protocol() #75813

jlacoline mannequin opened this issue Sep 29, 2017 · 4 comments
Labels
3.7 (EOL) end of life topic-asyncio type-bug An unexpected behavior, bug, or error

Comments

@jlacoline
Copy link
Mannequin

jlacoline mannequin commented Sep 29, 2017

BPO 31632
Nosy @1st1, @jlacoline
PRs
  • bpo-31632: (asyncio) remove local reference to app protocol in _SSLProtocolTransport #3817
  • [3.6] bpo-31632: fix set_protocol() in _SSLProtocolTransport (GH-3817) (GH-3817) #4052
  • 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 2017-10-19.17:50:44.809>
    created_at = <Date 2017-09-29.08:59:33.967>
    labels = ['type-bug', '3.7', 'expert-asyncio']
    title = 'Asyncio: SSL transport does not support set_protocol()'
    updated_at = <Date 2017-10-19.18:12:46.546>
    user = 'https://github.com/jlacoline'

    bugs.python.org fields:

    activity = <Date 2017-10-19.18:12:46.546>
    actor = 'yselivanov'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-10-19.17:50:44.809>
    closer = 'yselivanov'
    components = ['asyncio']
    creation = <Date 2017-09-29.08:59:33.967>
    creator = 'jlacoline'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 31632
    keywords = ['patch']
    message_count = 4.0
    messages = ['303313', '304626', '304627', '304631']
    nosy_count = 2.0
    nosy_names = ['yselivanov', 'jlacoline']
    pr_nums = ['3817', '4052']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue31632'
    versions = ['Python 3.6', 'Python 3.7']

    @jlacoline
    Copy link
    Mannequin Author

    jlacoline mannequin commented Sep 29, 2017

    The bug was encountered when using the HTTPS client of the aiohttp package.

    Calling the method set_protocol() on a SSL transport (_SSLProtocolTransport) does not have the expected result: the new protocol will never be used (i.e. its data_received() method won't be called). The previous one keeps receiving data.

    The problem comes from asyncio/ssl_proto.py:308. In my understanding, _SSLProtocolTransport is modifying its local reference to the protocol but does not modify the reference in SSLProtocol, which is the one that is actually called.
    So imo this line should look like "self.ssl_protocol._app_protocol = protocol"

    I'll submit a github PR soon to fix this issue.

    @jlacoline jlacoline mannequin added topic-asyncio type-bug An unexpected behavior, bug, or error labels Sep 29, 2017
    @1st1
    Copy link
    Member

    1st1 commented Oct 19, 2017

    New changeset ea2ef5d by Yury Selivanov (jlacoline) in branch 'master':
    bpo-31632: fix set_protocol() in _SSLProtocolTransport (bpo-3817) (bpo-3817)
    ea2ef5d

    @1st1
    Copy link
    Member

    1st1 commented Oct 19, 2017

    Loïc, thank you for the contribution!

    @1st1 1st1 added the 3.7 (EOL) end of life label Oct 19, 2017
    @1st1 1st1 closed this as completed Oct 19, 2017
    @1st1
    Copy link
    Member

    1st1 commented Oct 19, 2017

    New changeset 9c23b17 by Yury Selivanov (Miss Islington (bot)) in branch '3.6':
    bpo-31632: fix set_protocol() in _SSLProtocolTransport (GH-3817) (GH-3817) (bpo-4052)
    9c23b17

    @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
    Labels
    3.7 (EOL) end of life topic-asyncio type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant