mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Fixes #1636
This commit is contained in:
parent
147278733b
commit
49d3b463ed
@ -1,5 +1,7 @@
|
|||||||
import asyncio # for future uses
|
import asyncio # for future uses
|
||||||
|
import ssl
|
||||||
import aiohttp
|
import aiohttp
|
||||||
|
import certifi
|
||||||
from telebot import types
|
from telebot import types
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -27,11 +29,13 @@ REQUEST_LIMIT = 50
|
|||||||
class SessionManager:
|
class SessionManager:
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
self.session = None
|
self.session = None
|
||||||
|
self.ssl_context = ssl.create_default_context(cafile=certifi.where())
|
||||||
|
|
||||||
|
|
||||||
async def create_session(self):
|
async def create_session(self):
|
||||||
self.session = aiohttp.ClientSession(connector=aiohttp.TCPConnector(
|
self.session = aiohttp.ClientSession(connector=aiohttp.TCPConnector(
|
||||||
limit=REQUEST_LIMIT
|
limit=REQUEST_LIMIT,
|
||||||
|
ssl_context=self.ssl_context
|
||||||
))
|
))
|
||||||
return self.session
|
return self.session
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user