[issue27391] server_hostname should only be required when checking host names

Jim Fulton report at bugs.python.org
Wed Jun 29 10:36:01 EDT 2016


Jim Fulton added the comment:

I'm not sure I understand your question.

The documentation for create_connection, https://docs.python.org/3/library/asyncio-eventloop.html#creating-connections states that server_hostname is required if the host is empty. (I'm generalizing "empty" to include None.)

SSL contexts, https://docs.python.org/3/library/ssl.html#ssl-contexts,
have an attribute, check_hostname, which controls whether hostname checking is required. If set to false in a context passed to create_connection, then it makes no sense to require server_hostname under any circumstances.

Note that this is easy to work around by passing an empty string, it just seems pointless to make people do that if you're already controlling this via the SSL context.

----------

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


More information about the Python-bugs-list mailing list