1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Remove ssl

This commit is contained in:
coder2020official 2022-05-22 01:02:55 +05:00
parent 0c59d1187e
commit 8da749ee05
2 changed files with 3 additions and 6 deletions

View File

@ -2,4 +2,3 @@ pytest
requests==2.20.0
wheel==0.24.0
aiohttp>=3.8.0,<3.9.0
certifi

View File

@ -1,7 +1,6 @@
import asyncio # for future uses
import aiohttp
from telebot import types
import ssl, certifi
try:
import ujson as json
@ -27,15 +26,14 @@ REQUEST_LIMIT = 50
class SessionManager:
def __init__(self) -> None:
self.ssl_context = ssl.create_default_context(cafile=certifi.where())
self.session = aiohttp.ClientSession(connector=aiohttp.TCPConnector(
limit=REQUEST_LIMIT, ssl=self.ssl_context
limit=REQUEST_LIMIT
))
async def create_session(self):
self.session = aiohttp.ClientSession(connector=aiohttp.TCPConnector(
limit=REQUEST_LIMIT, ssl=self.ssl_context
limit=REQUEST_LIMIT
))
return self.session