2
2
import io
3
3
import json
4
4
import logging
5
- import warnings
6
5
from 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
18
7
19
8
import aiohttp
20
9
from aiohttp .client_exceptions import ClientResponseError
@@ -57,7 +46,7 @@ def __init__(
57
46
headers : Optional [LooseHeaders ] = None ,
58
47
cookies : Optional [LooseCookies ] = None ,
59
48
auth : Optional [Union [BasicAuth , "AppSyncAuthentication" ]] = None ,
60
- ssl : Union [SSLContext , bool , Fingerprint , str ] = "ssl_warning" ,
49
+ ssl : Union [SSLContext , bool , Fingerprint ] = True ,
61
50
timeout : Optional [int ] = None ,
62
51
ssl_close_timeout : Optional [Union [int , float ]] = 10 ,
63
52
json_serialize : Callable = json .dumps ,
@@ -71,7 +60,8 @@ def __init__(
71
60
:param cookies: Dict of HTTP cookies.
72
61
:param auth: BasicAuth object to enable Basic HTTP auth if needed
73
62
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.
75
65
:param ssl_close_timeout: Timeout in seconds to wait for the ssl connection
76
66
to close properly
77
67
:param json_serialize: Json serializer callable.
@@ -88,20 +78,7 @@ def __init__(
88
78
self .headers : Optional [LooseHeaders ] = headers
89
79
self .cookies : Optional [LooseCookies ] = cookies
90
80
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
105
82
self .timeout : Optional [int ] = timeout
106
83
self .ssl_close_timeout : Optional [Union [int , float ]] = ssl_close_timeout
107
84
self .client_session_args = client_session_args
0 commit comments