Commit ee84f0354c for bind
commit ee84f0354cc5053fd7fe503ea3d865e003bbea5d
Author: Michal Nowak <mnowak@isc.org>
Date: Fri Oct 9 15:05:44 2026 +0000
Build the HTTPS test TLS contexts with dns.query.make_ssl_context()
dnspython 2.8.0 added dns.query.make_ssl_context(), which builds a
client TLS context with certificate and hostname checks switched off
and ALPN set in a single call, instead of configuring an
ssl.SSLContext attribute by attribute.
Assisted-by: Claude:claude-opus-5-5
diff --git a/bin/tests/system/doth/tests_malicious.py b/bin/tests/system/doth/tests_malicious.py
index 13c7a7f143..ad7a377d7b 100644
--- a/bin/tests/system/doth/tests_malicious.py
+++ b/bin/tests/system/doth/tests_malicious.py
@@ -10,13 +10,13 @@
# information regarding copyright ownership.
import socket
-import ssl
from h2.config import H2Configuration
from h2.connection import H2Connection
from h2.settings import SettingCodes
import dns.message
+import dns.query
import isctest.mark
@@ -31,10 +31,9 @@ def test_settings_frame_flood(ns1, named_httpsport):
wire = msg.to_wire()
with socket.create_connection((ns1.ip, named_httpsport), timeout=10) as sock:
- ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
- ctx.check_hostname = False
- ctx.verify_mode = ssl.CERT_NONE
- ctx.set_alpn_protocols(["h2"])
+ ctx = dns.query.make_ssl_context(
+ verify=False, check_hostname=False, alpns=["h2"]
+ )
with ctx.wrap_socket(sock, server_hostname=ns1.ip) as tls:
config = H2Configuration(client_side=True, header_encoding="utf-8")
diff --git a/bin/tests/system/sig0_https/tests_sig0_https.py b/bin/tests/system/sig0_https/tests_sig0_https.py
index aa09d1e61e..5dae8f9e9f 100644
--- a/bin/tests/system/sig0_https/tests_sig0_https.py
+++ b/bin/tests/system/sig0_https/tests_sig0_https.py
@@ -10,7 +10,6 @@
# information regarding copyright ownership.
import socket
-import ssl
import struct
import time
@@ -18,6 +17,7 @@ from h2.connection import H2Connection
import dns.message
import dns.name
+import dns.query
import dns.rdata
import dns.rdataclass
import dns.rdatatype
@@ -77,9 +77,7 @@ def sig0_wire():
def test_sig0_doh(ns1, named_httpsport):
msg = sig0_wire()
- ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
- ctx.check_hostname = False
- ctx.verify_mode = ssl.CERT_NONE
+ ctx = dns.query.make_ssl_context(verify=False, check_hostname=False)
with socket.create_connection((ns1.ip, named_httpsport)) as sock:
with ctx.wrap_socket(sock) as conn: