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.

Author christian.heimes
Recipients alex, christian.heimes, docs@python, dstufft, janssen, njs, theandrew168
Date 2021-03-21.21:16:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1616361392.68.0.288832669923.issue43582@roundup.psfhosted.org>
In-reply-to
Content
The callback from context.alpn_callback would fire when OpenSSL handles the ALPN extension. Since the callback is triggered in the ClientHello phase of the handshake, you'll be able to replace the socket's context with another context.

The OpenSSL codes work a bit like this:

TLSEXT_INDEX = [
    ...,
    TLSEXT_IDX_server_name,
    ...,
    TLSEXT_IDX_application_layer_protocol_negotiation,
]

for extid in TLSEXT_INDEX:
    if client.has_extension(extid):
        ext = do_stuff(client, extid)
        ext.callback(client)

Any of the callbacks is able to replace the context.

The process for contributing to Python is explained in the devguide:
https://devguide.python.org/. Please start by signing a contributor agreement. Then you can file a PR on Github.
History
Date User Action Args
2021-03-21 21:16:32christian.heimessetrecipients: + christian.heimes, janssen, alex, njs, docs@python, dstufft, theandrew168
2021-03-21 21:16:32christian.heimessetmessageid: <1616361392.68.0.288832669923.issue43582@roundup.psfhosted.org>
2021-03-21 21:16:32christian.heimeslinkissue43582 messages
2021-03-21 21:16:32christian.heimescreate