-
Notifications
You must be signed in to change notification settings - Fork 298
xmltream.py: avoid using SSLv3 on unsupported systems. #470
base: develop
Are you sure you want to change the base?
Conversation
For many modern systems, SSLv3 have been completely removed by upstream providers. In this case, the system openssl doesn't support SSLv3, hence ssl.PROTOCOL_SSLv3 is no longer a valid attribute anymore. This commit checks whether the system supports SSLv3, avoid trying to call "ssl.PROTOCOL_SSLv3" if unsupported. A user-friendly notice is also written to the log, the documentation have been updated as well. Signed-off-by: Yifeng Li <tomli@tomli.me>
This should be included into stable versions as well. |
…nsupported systems
Also Python 3.6 and above have deprecated ssl.PROTOCOL_SSLv3 etc and now there's only ssl.PROTOCOL_TLS (though it looks like PROTOCOL_SSLv23 remains and is aliased to PROTOCOL_TLS). Should adding that case to the logic around line 470 also be implemented in this PR? Other than that I think this should be merged as soon as possible since this package is broken on up to date machines and it has been over a year since it was proposed. |
I've clarified in the comments.
So I think it can still be kept as-is. |
So you don't get an attribute error with Python 3.6? As far as I can tell if openSSL is compiled without SSLv3 support then the attribute ssl.PROTOCOL_SSLv3 won't exist and it will fail there. (Refer to std library docs for ssl module post Python 3.4) |
No, ssl.PROTOCOL_SSLv3 won't exist, this is what the pull request is fixing. But ssl.PROTOCOL_SSLv23 does exist. |
Ah sorry, I think I had also commented on the PR before this one and ended up confusing them. All good then. |
@bear Could you please have a look at this? |
Linked to: #500 |
For many modern systems, SSLv3 have been completely removed by
upstream providers. In this case, the system openssl doesn't
support SSLv3, hence ssl.PROTOCOL_SSLv3 is no longer a valid
attribute anymore.
This commit checks whether the system supports SSLv3, avoid
trying to call "ssl.PROTOCOL_SSLv3" if unsupported. A user-friendly
notice is also written to the log, the documentation have been
updated as well.
Signed-off-by: Yifeng Li tomli@tomli.me