Try disabling check hostname on time checks

This commit is contained in:
Jay Lee
2022-10-29 11:21:00 -04:00
committed by GitHub
parent f412d5ad4c
commit dc22b024b8

View File

@@ -640,6 +640,7 @@ def getLocalGoogleTimeOffset(testLocation='admin.googleapis.com'):
# is way off. This could be spoofed / MitM but we'll fail for those
# situations everywhere else but here.
badhttp = transport.create_http()
badhttp.check_hostname = False
badhttp.disable_ssl_certificate_validation = True
googleUTC = dateutil.parser.parse(
badhttp.request('https://' + testLocation, 'HEAD')[0]['date'])