Use certifi to ensure CA certificates are bundled in pyinstaller

This commit is contained in:
I-Al-Istannen 2021-05-25 18:09:51 +02:00
parent 07a75a37c3
commit 263780e6a3
2 changed files with 4 additions and 0 deletions

View File

@ -1,8 +1,10 @@
import asyncio import asyncio
import ssl
from pathlib import Path, PurePath from pathlib import Path, PurePath
from typing import Dict, List, Optional from typing import Dict, List, Optional
import aiohttp import aiohttp
import certifi
from aiohttp.client import ClientTimeout from aiohttp.client import ClientTimeout
from ..auth import Authenticator from ..auth import Authenticator
@ -155,6 +157,7 @@ class HttpCrawler(Crawler):
async with aiohttp.ClientSession( async with aiohttp.ClientSession(
headers={"User-Agent": f"{NAME}/{VERSION}"}, headers={"User-Agent": f"{NAME}/{VERSION}"},
cookie_jar=self._cookie_jar, cookie_jar=self._cookie_jar,
connector=aiohttp.TCPConnector(ssl=ssl.create_default_context(cafile=certifi.where())),
timeout=ClientTimeout( timeout=ClientTimeout(
# 30 minutes. No download in the history of downloads was longer than 30 minutes. # 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. # This is enough to transfer a 600 MB file over a 3 Mib/s connection.

View File

@ -10,6 +10,7 @@ install_requires =
beautifulsoup4>=4.9.3 beautifulsoup4>=4.9.3
rich>=10.1.0 rich>=10.1.0
keyring>=23.0.1 keyring>=23.0.1
certifi>=2020.12.5
[options.entry_points] [options.entry_points]
console_scripts = console_scripts =