[WIP] [DON'T MERGE] Use ssl.PROTOCOL_SSLv23 constant by default under Python >= 2.7.9 < 3 and >= 3.4 - #683
Closed
Kami wants to merge 3 commits into
Closed
Conversation
… 2.7.9 and Python >= 3.4 by default. In those versions SSL v3.0 is disabled by default so it's safe to use this constant and it results in the best compatibility since it will use TLS v1.0 / v1.1 / v1.2 based on the versions supported by the server. Also refactor exception wrapping functionality into a separate function.
Member
Author
|
I'm still contemplating if it's worth to finish this or if we should just switch to Switching to |
|
I'd vote for moving to requests. Let libcloud focus on the multi-cloud aspect and let requests handle the http heavy lifting. We'd have to drop Python 2.5 support, but I think that's ok. |
Contributor
|
we don't support py 2.5 anymore @jimbobhickville so thats ok. |
Member
Author
|
I'm closing this. Hopefully we can move to requests in the near future and we don't need this code anymore. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note: This pull request is W.I.P. and not yet ready to be reviewed and merged.
This pull request updates the code to use
ssl.PROTOCOL_SSLv23constant forssl_versionattribute when establishing SSL / TLS connection when using Python >= 2.7.9 < 3 and Python >= 3.4.This constant offers the best security and compatibility since it will pick between TLS v1.0, TLS v1.1 and TLS v1.2 depending on the version supported / requested by the server. This is only done under aforementioned Python versions since un-secure SSL v3.0 is disabled by default in those versions.
In other versions where SSL v3.0 is not disabled we still use TLS v1.0 (
ssl.PROTOCOL_TLSv1) which means nothing has changed - that's the same as the old / existing behavior.Another thing to keep in mind is that user can also explicitly specify which version they want to use using
libcloud.security.SSL_VERSIONvariable and this value has precedence over dynamically obtained values.Ideally, if users know that the server supports TLS v1.2 they should explicitly specify and use that aka the highest supported versions (that's also mentioned in the documentation).