Fix a crash when setting a servername callback on a SSL server socket and the client doesn't send a server name.

Patch by Kazuhiro Yoshida.
(originally issue #8109)
This commit is contained in:
Antoine Pitrou 2013-04-11 20:48:42 +02:00
parent 85b2afb1b1
commit 50b24d0d7c
4 changed files with 30 additions and 13 deletions

View file

@ -842,6 +842,7 @@ to speed up repeated connections from the same clients.
The callback function, *server_name_callback*, will be called with three
arguments; the first being the :class:`ssl.SSLSocket`, the second is a string
that represents the server name that the client is intending to communicate
(or :const:`None` if the TLS Client Hello does not contain a server name)
and the third argument is the original :class:`SSLContext`. The server name
argument is the IDNA decoded server name.