Added certifi

This commit is contained in:
Alex Root Junior 2022-11-12 21:52:27 +02:00
parent 0294bf2853
commit a2f044e199
No known key found for this signature in database
GPG key ID: 074C1D455EBEA4AC
5 changed files with 10 additions and 4 deletions

View file

@ -1,6 +1,7 @@
from __future__ import annotations
import asyncio
import ssl
from typing import (
TYPE_CHECKING,
Any,
@ -15,6 +16,7 @@ from typing import (
cast,
)
import certifi
from aiohttp import BasicAuth, ClientError, ClientSession, FormData, TCPConnector
from aiogram.methods import Request, TelegramMethod
@ -81,7 +83,9 @@ class AiohttpSession(BaseSession):
self._session: Optional[ClientSession] = None
self._connector_type: Type[TCPConnector] = TCPConnector
self._connector_init: Dict[str, Any] = {}
self._connector_init: Dict[str, Any] = {
"ssl": ssl.create_default_context(cafile=certifi.where()),
}
self._should_reset_connector = True # flag determines connector state
self._proxy: Optional[_ProxyType] = None

4
poetry.lock generated
View file

@ -144,7 +144,7 @@ uvloop = ["uvloop (>=0.15.2)"]
name = "certifi"
version = "2022.9.24"
description = "Python package for providing Mozilla's CA Bundle."
category = "dev"
category = "main"
optional = false
python-versions = ">=3.6"
@ -1207,7 +1207,7 @@ redis = ["redis"]
[metadata]
lock-version = "1.1"
python-versions = "^3.8"
content-hash = "0845f5cc5f08f26d2780e6696fe66d84aab76cf5f720b742839f34552377a9fa"
content-hash = "e991e2d07149ee26d0d46cf799de2b6dc35207dc462ef5b940badc7f26b65a1e"
[metadata.files]
aiofiles = [

View file

@ -58,6 +58,7 @@ Babel = { version = "^2.9.1", optional = true }
aiohttp-socks = { version = "^0.7.1", optional = true }
# Redis
redis = { version = "^4.3.4", optional = true }
certifi = "^2022.9.24"
[tool.poetry.group.docs.dependencies]

View file

@ -4,6 +4,7 @@ aiosignal==1.2.0 ; python_version >= "3.8" and python_version < "4.0"
async-timeout==4.0.2 ; python_version >= "3.8" and python_version < "4.0"
attrs==22.1.0 ; python_version >= "3.8" and python_version < "4.0"
babel==2.10.3 ; python_version >= "3.8" and python_version < "4.0"
certifi==2022.9.24 ; python_version >= "3.8" and python_version < "4.0"
charset-normalizer==2.1.1 ; python_version >= "3.8" and python_version < "4.0"
frozenlist==1.3.1 ; python_version >= "3.8" and python_version < "4.0"
idna==3.4 ; python_version >= "3.8" and python_version < "4.0"

View file

@ -7,7 +7,7 @@ async-timeout==4.0.2 ; python_version >= "3.8" and python_version < "4.0"
attrs==22.1.0 ; python_version >= "3.8" and python_version < "4.0"
babel==2.10.3 ; python_version >= "3.8" and python_version < "4.0"
beautifulsoup4==4.11.1 ; python_version >= "3.8" and python_version < "4.0"
certifi==2022.9.24 ; python_version >= "3.8" and python_version < "4"
certifi==2022.9.24 ; python_version >= "3.8" and python_version < "4.0"
charset-normalizer==2.1.1 ; python_version >= "3.8" and python_version < "4.0"
click-default-group==1.2.2 ; python_version >= "3.8" and python_version < "4.0"
click==8.1.3 ; python_version >= "3.8" and python_version < "4.0"