[issue17181] SSLContext.set_servername_callback should be able to set argument

2021-10-21 Thread Christian Heimes


Christian Heimes  added the comment:

As Antoine said, you can use a partial function, closure, or an instance method 
as a callable.

Besides nobody else has requested an additional argument in the past eight 
years. I see this as a strong indication that an argument is not required.

--
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17181] SSLContext.set_servername_callback should be able to set argument

2021-10-21 Thread Irit Katriel


Change by Irit Katriel :


--
nosy: +christian.heimes

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17181] SSLContext.set_servername_callback should be able to set argument

2013-02-11 Thread Daniel Black

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 rep...@bugs.python.org
http://bugs.python.org/issue17181
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17181] SSLContext.set_servername_callback should be able to set argument

2013-02-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 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)

But you could simply use a closure:

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

self.context.set_servername_callback(cb_sni)

--
title: SSLContext.set_servername_callback should be able to set argument - 
SSLContext.set_servername_callback should be able to setargument

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17181
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17181] SSLContext.set_servername_callback should be able to set argument

2013-02-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

(functools.partial is another solution to the problem)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17181
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com