22import io
33import json
44import logging
5- import warnings
65from ssl import SSLContext
7- from typing import (
8- Any ,
9- AsyncGenerator ,
10- Callable ,
11- Dict ,
12- Optional ,
13- Tuple ,
14- Type ,
15- Union ,
16- cast ,
17- )
6+ from typing import Any , AsyncGenerator , Callable , Dict , Optional , Tuple , Type , Union
187
198import aiohttp
209from aiohttp .client_exceptions import ClientResponseError
@@ -57,7 +46,7 @@ def __init__(
5746 headers : Optional [LooseHeaders ] = None ,
5847 cookies : Optional [LooseCookies ] = None ,
5948 auth : Optional [Union [BasicAuth , "AppSyncAuthentication" ]] = None ,
60- ssl : Union [SSLContext , bool , Fingerprint , str ] = "ssl_warning" ,
49+ ssl : Union [SSLContext , bool , Fingerprint ] = True ,
6150 timeout : Optional [int ] = None ,
6251 ssl_close_timeout : Optional [Union [int , float ]] = 10 ,
6352 json_serialize : Callable = json .dumps ,
@@ -71,7 +60,8 @@ def __init__(
7160 :param cookies: Dict of HTTP cookies.
7261 :param auth: BasicAuth object to enable Basic HTTP auth if needed
7362 Or Appsync Authentication class
74- :param ssl: ssl_context of the connection. Use ssl=False to disable encryption
63+ :param ssl: ssl_context of the connection.
64+ Use ssl=False to not verify ssl certificates.
7565 :param ssl_close_timeout: Timeout in seconds to wait for the ssl connection
7666 to close properly
7767 :param json_serialize: Json serializer callable.
@@ -88,20 +78,7 @@ def __init__(
8878 self .headers : Optional [LooseHeaders ] = headers
8979 self .cookies : Optional [LooseCookies ] = cookies
9080 self .auth : Optional [Union [BasicAuth , "AppSyncAuthentication" ]] = auth
91-
92- if ssl == "ssl_warning" :
93- ssl = False
94- if str (url ).startswith ("https" ):
95- warnings .warn (
96- "WARNING: By default, AIOHTTPTransport does not verify"
97- " ssl certificates. This will be fixed in the next major version."
98- " You can set ssl=True to force the ssl certificate verification"
99- " or ssl=False to disable this warning"
100- )
101-
102- self .ssl : Union [SSLContext , bool , Fingerprint ] = cast (
103- Union [SSLContext , bool , Fingerprint ], ssl
104- )
81+ self .ssl : Union [SSLContext , bool , Fingerprint ] = ssl
10582 self .timeout : Optional [int ] = timeout
10683 self .ssl_close_timeout : Optional [Union [int , float ]] = ssl_close_timeout
10784 self .client_session_args = client_session_args
0 commit comments