Skip to content

Commit a4dce65

Browse files
committed
ci: don't verify TLS certificates when downloading favicon
1 parent e0903e4 commit a4dce65

1 file changed

Lines changed: 16 additions & 10 deletions

File tree

afm-list-manager.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,12 @@ def download_favicon(url, download_dir):
253253
parsed_uri = urlparse(url)
254254
domain = '{uri.scheme}://{uri.netloc}/'.format(uri=parsed_uri)
255255
# get favicon
256-
resp = requests.get(domain + "/favicon.ico")
256+
with warnings.catch_warnings():
257+
warnings.simplefilter(
258+
"ignore",
259+
category=urllib3.connectionpool.InsecureRequestWarning
260+
)
261+
resp = requests.get(domain + "/favicon.ico", verify=False)
257262
if resp.status_code == 200:
258263
path = download_dir / (parsed_uri.netloc + ".ico")
259264
with path.open("wb") as fd:
@@ -339,15 +344,16 @@ def verify_url(url):
339344
# Out of scope to check SSL certificates
340345
verify=False,
341346
)
342-
if request.status_code in ALIVE_BUT_BLOCKING:
343-
request = requests.get(
344-
url,
345-
headers=headers,
346-
allow_redirects=True,
347-
timeout=15,
348-
stream=True,
349-
)
350-
request.close()
347+
if request.status_code in ALIVE_BUT_BLOCKING:
348+
request = requests.get(
349+
url,
350+
headers=headers,
351+
allow_redirects=True,
352+
timeout=15,
353+
stream=True,
354+
verify=False
355+
)
356+
request.close()
351357
return request.status_code == 200 or request.status_code in ALIVE_BUT_BLOCKING
352358
except requests.RequestException:
353359
return False

0 commit comments

Comments
 (0)