[New-bugs-announce] [issue17181] SSLContext.set_servername_callback should be able to set argument

Daniel Black report at bugs.python.org
Mon Feb 11 11:07:39 CET 2013


New submission from Daniel Black:

I think my original implementation of the SNI callback to see a original sslcontext was wrong. It would be much more useful for the SSLContext.set_servername_callback to take a callable and an object as an argument.

This would allow constructs like the following where self can be used within the callback. Example:

        def cb_sni(ssl_sock, server_name, self):
            self.sniname = server_name

        self.context.set_servername_callback(cb_sni, self)

The original functionality can still occur with:

        self.context.set_servername_callback(cb_sni, self.context)

Agree?

----------
components: Library (Lib)
messages: 181889
nosy: grooverdan, pitrou
priority: normal
severity: normal
status: open
title: SSLContext.set_servername_callback should be able to set argument
type: enhancement
versions: Python 3.5

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


More information about the New-bugs-announce mailing list