Skip to content

Commit 5daef2a

Browse files
Merge pull request pyppeteer#301 from bollwyvl/add-certifi
Re-add certifi
2 parents a5dcd44 + de0025d commit 5daef2a

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

pyppeteer/chromium_downloader.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from pathlib import Path
1212
from zipfile import ZipFile
1313

14+
import certifi
1415
import urllib3
1516
from pyppeteer import __chromium_revision__, __pyppeteer_home__
1617
from tqdm import tqdm
@@ -68,14 +69,7 @@ def download_zip(url: str) -> BytesIO:
6869
"""Download data from url."""
6970
logger.warning('Starting Chromium download. ' 'Download may take a few minutes.')
7071

71-
# Uncomment the statement below to disable HTTPS warnings and allow
72-
# download without certificate verification. This is *strongly* as it
73-
# opens the code to man-in-the-middle (and other) vulnerabilities; see
74-
# https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings
75-
# for more.
76-
# urllib3.disable_warnings()
77-
78-
with urllib3.PoolManager() as http:
72+
with urllib3.PoolManager(cert_reqs='CERT_REQUIRED', ca_certs=certifi.where()) as http:
7973
# Get data from url.
8074
# set preload_content=False means using stream later.
8175
r = http.request('GET', url, preload_content=False)

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ pyee = "^8.1.0"
5151
tqdm = "^4.42.1"
5252
urllib3 = "^1.25.8"
5353
websockets = "^9.1"
54+
certifi = ">=2021"
5455

5556
[tool.poetry.dev-dependencies]
5657
tox = "^3.20.1"

0 commit comments

Comments
 (0)