]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
fix test TLS alert
authorBob Halley <halley@dnspython.org>
Thu, 17 Feb 2022 16:29:52 +0000 (08:29 -0800)
committerBob Halley <halley@dnspython.org>
Thu, 17 Feb 2022 16:29:52 +0000 (08:29 -0800)
tests/test_query.py

index 48c8b8412df764a67f8db48d026d95d87479cf98..2d954e366963def19acbe3a8053ea5a1d579e273 100644 (file)
@@ -151,6 +151,10 @@ class QueryTests(unittest.TestCase):
                 base_s.settimeout(2)
                 base_s.connect(ll)
                 ctx = ssl.create_default_context()
+                if sys.version_info >= (3, 7):
+                    ctx.minimum_version = ssl.TLSVersion.TLSv1_2
+                else:
+                    ctx.options |= ssl.OP_NO_TLSv1 | ssl.OP_NO_TLSv1_1
                 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.')