我正在使用烧瓶客户端执行 openid 身份验证。但是我收到以下警告
Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
获取令牌时,使用 requests.Session.requests 完成请求。
OAuth2Session
应用修复警告的请求方法。
def request(self, method, url, withhold_token=False, auth=None, **kwargs):
"""Send request with auto refresh token feature (if available)."""
if not withhold_token and auth is None:
if not self.token:
raise MissingTokenError()
auth = self.token_auth
return super(OAuth2Session, self).request(
method, url, auth=auth, verify=True, **kwargs)
默认情况下不应该启用验证吗?有没有更优雅的方式来传递 verify=True?