From 73badd1e27d54f74a3d7815a3edb911f5db394a0 Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Fri, 7 Jul 2023 07:29:08 -0700 Subject: [PATCH] In async TLS do not ignore a ssl_context given as an argument [#951]. 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 | 3 --- 1 file changed, 3 deletions(-) diff --git a/dns/asyncquery.py b/dns/asyncquery.py index 54093c17..4e660b53 100644 --- a/dns/asyncquery.py +++ b/dns/asyncquery.py @@ -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) -- 2.47.3