Skip to content

Commit

Permalink
disable test failing due to expired certificate
Browse files Browse the repository at this point in the history
(cherry picked from commit fc62d2f)
  • Loading branch information
rthalley committed Jul 18, 2023
1 parent b0605d8 commit bc5b80d
Showing 1 changed file with 24 additions and 21 deletions.
45 changes: 24 additions & 21 deletions tests/test_doh.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
import unittest
import random
import socket
import unittest

try:
import ssl
Expand Down Expand Up @@ -147,26 +147,29 @@ def test_build_url_from_ip(self):
)
self.assertTrue(q.is_response(r))

def test_bootstrap_address_fails(self):
# We test this to see if v4 is available
if resolver_v4_addresses:
ip = "185.228.168.168"
invalid_tls_url = "https://{}/doh/family-filter/".format(ip)
valid_tls_url = "https://doh.cleanbrowsing.org/doh/family-filter/"
q = dns.message.make_query("example.com.", dns.rdatatype.A)
# make sure CleanBrowsing's IP address will fail TLS certificate
# check.
with self.assertRaises(httpx.ConnectError):
dns.query.https(q, invalid_tls_url, session=self.session, timeout=4)
# And if we don't mangle the URL, it should work.
r = dns.query.https(
q,
valid_tls_url,
session=self.session,
bootstrap_address=ip,
timeout=4,
)
self.assertTrue(q.is_response(r))
# This test is temporarily disabled as there's an expired certificate issue on one
# of the servers, so it fails on the part that is supposed to succeed (2023-07-15).

# def test_bootstrap_address_fails(self):
# # We test this to see if v4 is available
# if resolver_v4_addresses:
# ip = "185.228.168.168"
# invalid_tls_url = "https://{}/doh/family-filter/".format(ip)
# valid_tls_url = "https://doh.cleanbrowsing.org/doh/family-filter/"
# q = dns.message.make_query("example.com.", dns.rdatatype.A)
# # make sure CleanBrowsing's IP address will fail TLS certificate
# # check.
# with self.assertRaises(httpx.ConnectError):
# dns.query.https(q, invalid_tls_url, session=self.session, timeout=4)
# # And if we don't mangle the URL, it should work.
# r = dns.query.https(
# q,
# valid_tls_url,
# session=self.session,
# bootstrap_address=ip,
# timeout=4,
# )
# self.assertTrue(q.is_response(r))

def test_new_session(self):
nameserver_url = random.choice(KNOWN_ANYCAST_DOH_RESOLVER_URLS)
Expand Down

0 comments on commit bc5b80d

Please sign in to comment.