Skip to content

Commit 70fae93

Browse files
committed
[Infrastructure] Disable TSL cert verification for link checker
1 parent 2bdbb1a commit 70fae93

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

org.jcryptool.releng/helper/link_availability_checker.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import multiprocessing
1111
import os
1212
import re
13+
import ssl
1314
import socket
1415
import sys
1516
from abc import ABC
@@ -97,7 +98,12 @@ def send_request(context: PingContext) -> PingContext:
9798
"""Send a request and save the return status code and possible errors."""
9899
req = Request(context.url, headers={"User-Agent": DefaultSettings.USER_AGENT.value})
99100
try:
100-
_response = urlopen(req, timeout=context.timeout)
101+
# There were cert issues, so disable cert checking completely
102+
ctx = ssl.create_default_context()
103+
ctx.check_hostname = False
104+
ctx.verify_mode = ssl.CERT_NONE
105+
106+
_response = urlopen(req, timeout=context.timeout, context=ctx)
101107
context.status = Status.OK
102108
context.http_code = _response.getcode()
103109
context.error_reason = None

0 commit comments

Comments
 (0)