@@ -14,7 +14,7 @@ class CommonLoginHelper(interRoot):
14
14
def __init__ (self ):
15
15
self .lang = self .INS .i18n .get_bundle ("app.common.loginHelper" , func = True )
16
16
self .requests = requests .Session ()
17
- self .requests .mount ("https://" , CustomAdapter ())
17
+ # self.requests.mount("https://", CustomAdapter())
18
18
self .token_getter = TokenGetter (lang = self .lang , requests = self .requests )
19
19
self .proxy = ""
20
20
self .auth_token_url = ""
@@ -152,19 +152,19 @@ def _get(cls, url, proxy="", silent=False):
152
152
return True
153
153
154
154
155
- class CustomAdapter (requests .adapters .HTTPAdapter ):
156
- """
157
- 防止在请求 Cloudflare 时可能的 SSL 相关错误。
158
- Thanks to @github/grawity.
159
- """
155
+ # class CustomAdapter(requests.adapters.HTTPAdapter):
156
+ # """
157
+ # 防止在请求 Cloudflare 时可能的 SSL 相关错误。
158
+ # Thanks to @github/grawity.
159
+ # """
160
160
161
- def init_poolmanager (self , * args , ** kwargs ):
162
- # When urllib3 hand-rolls a SSLContext, it sets 'options |= OP_NO_TICKET'
163
- # and CloudFlare really does not like this. We cannot control this behavior
164
- # in urllib3, but we can just pass our own standard context instead.
165
- import ssl
161
+ # def init_poolmanager(self, *args, **kwargs):
162
+ # # When urllib3 hand-rolls a SSLContext, it sets 'options |= OP_NO_TICKET'
163
+ # # and CloudFlare really does not like this. We cannot control this behavior
164
+ # # in urllib3, but we can just pass our own standard context instead.
165
+ # import ssl
166
166
167
- ctx = ssl .create_default_context (ssl .Purpose .CLIENT_AUTH )
168
- ctx .load_default_certs ()
169
- ctx .set_alpn_protocols (["http/1.1" ])
170
- return super ().init_poolmanager (* args , ** kwargs , ssl_context = ctx )
167
+ # ctx = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
168
+ # ctx.load_default_certs()
169
+ # ctx.set_alpn_protocols(["http/1.1"])
170
+ # return super().init_poolmanager(*args, **kwargs, ssl_context=ctx)
0 commit comments