Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hide misleading ssl security warning in python>=2.7.9 #875

Merged
merged 3 commits into from
Oct 15, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
hide misleading ssl security warning in python>=2.7.9
  • Loading branch information
asottile-sentry committed Sep 15, 2022
commit 994e3a8003e42131b40428b6d1fc5e7301590b5a
15 changes: 8 additions & 7 deletions stripe/http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,14 @@ def new_default_http_client(*args, **kwargs):
impl = PycurlClient
else:
impl = Urllib2Client
warnings.warn(
"Warning: the Stripe library is falling back to urllib2/urllib "
"because neither requests nor pycurl are installed. "
"urllib2's SSL implementation doesn't verify server "
"certificates. For improved security, we suggest installing "
"requests."
)
if sys.version_info < (2, 7, 9),
warnings.warn(
"Warning: the Stripe library is falling back to urllib2 "
"because neither requests nor pycurl are installed. "
"urllib2's SSL implementation doesn't verify server "
"certificates. For improved security, we suggest installing "
"requests."
)

return impl(*args, **kwargs)

Expand Down