Christian Heimes <li...@cheimes.de> added the comment:
SSLContext.set_alpn_protocols() is a high level interface on top of SSL_CTX_set_alpn_select_cb(). Python doesn't directly expose the ALPN selector callback. The ssl module only provides a way to set a hard-coded callback that wraps SSL_select_next_proto(). https://github.com/python/cpython/blob/9a50ef43e42ee32450a81ce13ed5a0729d3b84e8/Modules/_ssl.c#L3487-L3535 https://github.com/python/cpython/blob/9a50ef43e42ee32450a81ce13ed5a0729d3b84e8/Modules/_ssl.c#L3393-L3415 To solve your problem Python would have to support something like: def alpn_cb(sslsocket, client_alpn_protocols, negotiated): return negotiated context.alpn_cb = alpn_cb ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue43582> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com