]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
lgtm lint: suppress false positive
authorBob Halley <halley@dnspython.org>
Thu, 17 Feb 2022 16:00:13 +0000 (08:00 -0800)
committerBob Halley <halley@dnspython.org>
Thu, 17 Feb 2022 16:00:13 +0000 (08:00 -0800)
dns/query.py
tests/test_query.py

index c399941be9cd10781031572fcc41b0cd809fadc1..875fcc0f9ab3a9e94ea471ba715e861931fd9a1a 100644 (file)
@@ -239,7 +239,8 @@ def _make_socket(af, type, source, ssl_context=None, server_hostname=None):
         if source is not None:
             s.bind(source)
         if ssl_context:
-            return ssl_context.wrap_socket(s, do_handshake_on_connect=False,
+            # LGTM gets a false positive here, as our default context is OK
+            return ssl_context.wrap_socket(s, do_handshake_on_connect=False,  # lgtm[py/insecure-protocol]
                                            server_hostname=server_hostname)
         else:
             return s
index 2cff3770379fe059d80acbebfce27cc82cf9bef2..48c8b8412df764a67f8db48d026d95d87479cf98 100644 (file)
@@ -151,7 +151,7 @@ class QueryTests(unittest.TestCase):
                 base_s.settimeout(2)
                 base_s.connect(ll)
                 ctx = ssl.create_default_context()
-                with ctx.wrap_socket(base_s, server_hostname='dns.google') as s:
+                with ctx.wrap_socket(base_s, server_hostname='dns.google') as s:  # lgtm[py/insecure-protocol]
                     s.setblocking(0)
                     qname = dns.name.from_text('dns.google.')
                     q = dns.message.make_query(qname, dns.rdatatype.A)