[issue5639] Support TLS SNI extension in ssl module

Jean-Paul Calderone report at bugs.python.org
Sun May 23 00:17:48 CEST 2010


Jean-Paul Calderone <exarkun at twistedmatrix.com> added the comment:

Here's another possible approach:

ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
ctx.set_tlsext_host_name("foo.bar")
skt = ctx.wrap_socket(socket.socket())
skt.connect("bar.baz")

This makes it obvious what the SNI hostname is and what the TCP address to connect to is, and they can easily be different.

----------
nosy: +exarkun

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5639>
_______________________________________


More information about the Python-bugs-list mailing list