Skip to content

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

Description

@jlacoline
mannequin
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']

    Activity

    1. jlacoline commented on Sep 29, 2017

      jlacolinemannequin
      MannequinAuthor

      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.

    2. 1st1 commented on Oct 19, 2017

      @1st1
      Member

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

    3. 1st1 commented on Oct 19, 2017

      @1st1
      Member

      Loïc, thank you for the contribution!

    4. 1st1 commented on Oct 19, 2017

      @1st1
      Member

      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

    5. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions