]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Fix httpx verify bug.
authorBrian Wellington <bwelling@xbill.org>
Fri, 25 Mar 2022 20:21:16 +0000 (13:21 -0700)
committerBrian Wellington <bwelling@xbill.org>
Fri, 25 Mar 2022 20:21:16 +0000 (13:21 -0700)
If both source and verify are passed to dns.query.https() when using
httpx, the verify parameter is ignored.  This is because the code
creates a custom transport for the source address, and httpx only uses the
verify parameter when creating a transport.

The fix is to pass in the verify parameter when we create a transport.

dns/query.py

index 1dd32830e58d9c6edbc809c26b7f2b1844c3df84..7fa50b93eeddfc588482af33caeb37f82d975216 100644 (file)
@@ -357,7 +357,7 @@ def https(
         # set source port and source address
         if _have_httpx:
             if source_port == 0:
-                transport = httpx.HTTPTransport(local_address=source[0])
+                transport = httpx.HTTPTransport(local_address=source[0], verify=verify)
             else:
                 _httpx_ok = False
         if _have_requests: