mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Remove ssl
This commit is contained in:
parent
0c59d1187e
commit
8da749ee05
@ -1,5 +1,4 @@
|
|||||||
pytest
|
pytest
|
||||||
requests==2.20.0
|
requests==2.20.0
|
||||||
wheel==0.24.0
|
wheel==0.24.0
|
||||||
aiohttp>=3.8.0,<3.9.0
|
aiohttp>=3.8.0,<3.9.0
|
||||||
certifi
|
|
@ -1,7 +1,6 @@
|
|||||||
import asyncio # for future uses
|
import asyncio # for future uses
|
||||||
import aiohttp
|
import aiohttp
|
||||||
from telebot import types
|
from telebot import types
|
||||||
import ssl, certifi
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import ujson as json
|
import ujson as json
|
||||||
@ -27,15 +26,14 @@ REQUEST_LIMIT = 50
|
|||||||
|
|
||||||
class SessionManager:
|
class SessionManager:
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
self.ssl_context = ssl.create_default_context(cafile=certifi.where())
|
|
||||||
self.session = aiohttp.ClientSession(connector=aiohttp.TCPConnector(
|
self.session = aiohttp.ClientSession(connector=aiohttp.TCPConnector(
|
||||||
limit=REQUEST_LIMIT, ssl=self.ssl_context
|
limit=REQUEST_LIMIT
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
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, ssl=self.ssl_context
|
limit=REQUEST_LIMIT
|
||||||
))
|
))
|
||||||
return self.session
|
return self.session
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user