From 263780e6a3429458dff17945fbac91c2a482451e Mon Sep 17 00:00:00 2001 From: I-Al-Istannen Date: Tue, 25 May 2021 18:09:51 +0200 Subject: [PATCH] Use certifi to ensure CA certificates are bundled in pyinstaller --- PFERD/crawl/http_crawler.py | 3 +++ setup.cfg | 1 + 2 files changed, 4 insertions(+) diff --git a/PFERD/crawl/http_crawler.py b/PFERD/crawl/http_crawler.py index 177972b..9f52c66 100644 --- a/PFERD/crawl/http_crawler.py +++ b/PFERD/crawl/http_crawler.py @@ -1,8 +1,10 @@ import asyncio +import ssl from pathlib import Path, PurePath from typing import Dict, List, Optional import aiohttp +import certifi from aiohttp.client import ClientTimeout from ..auth import Authenticator @@ -155,6 +157,7 @@ class HttpCrawler(Crawler): async with aiohttp.ClientSession( headers={"User-Agent": f"{NAME}/{VERSION}"}, cookie_jar=self._cookie_jar, + connector=aiohttp.TCPConnector(ssl=ssl.create_default_context(cafile=certifi.where())), timeout=ClientTimeout( # 30 minutes. No download in the history of downloads was longer than 30 minutes. # This is enough to transfer a 600 MB file over a 3 Mib/s connection. diff --git a/setup.cfg b/setup.cfg index 3b6e43b..5758282 100644 --- a/setup.cfg +++ b/setup.cfg @@ -10,6 +10,7 @@ install_requires = beautifulsoup4>=4.9.3 rich>=10.1.0 keyring>=23.0.1 + certifi>=2020.12.5 [options.entry_points] console_scripts =