]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
In async TLS do not ignore a ssl_context given as an argument [#951].
authorBob Halley <halley@dnspython.org>
Fri, 7 Jul 2023 14:29:08 +0000 (07:29 -0700)
committerBob Halley <halley@dnspython.org>
Fri, 7 Jul 2023 14:29:08 +0000 (07:29 -0700)
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.

dns/asyncquery.py

index 54093c17a0b0f97661caae588445ba1b52a740c8..4e660b535332237848b016ec7dd3c864a07e2fda 100644 (file)
@@ -443,9 +443,6 @@ async def 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)