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

use default context instead of setting specific one #35

Merged
merged 1 commit into from
Aug 29, 2018

Conversation

pedropregueiro
Copy link
Contributor

Fixes #34

I found that using the default context creation tool from ssl actually solved my issue so I decided to open this PR. According to the official python docs, this is what the method does:

Return a new SSLContext object with default settings for the given purpose. The settings are chosen by the ssl module, and usually represent a higher security level than when calling the SSLContext constructor directly.

The tests passed fine on my local branch, but I'm not 100% sure the tests are good enough. Open to suggestions re. better testing of this.

Copy link
Contributor

@psbanka psbanka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, the ssl.PROTOCOL_TLS version works fine in python 3.6.5, but your version using ssl.create_default_context() produces the same output, is potentially more secure, and is simpler. I did not try to reproduce your error on Python 3.4, but I'll take your word for it that this solves your error. Thanks for the bug report and the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants