The async TLS code would always fail if given an ssl_context instead
of making one, as it set the passed paramter to None and then called
into the async socket backend, which would make a regular TCP socket
(i.e. no TLS), which would be rejected by the server as it wasn't
using TLS.
ssl_context.minimum_version = ssl.TLSVersion.TLSv1_2
if server_hostname is None:
ssl_context.check_hostname = False
- else:
- ssl_context = None
- server_hostname = None
af = dns.inet.af_for_address(where)
stuple = _source_tuple(af, source, source_port)
dtuple = (where, port)