-
Notifications
You must be signed in to change notification settings - Fork 7
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
[SSL: CERTIFICATE_VERIFY_FAILED] for self-signed certs in Python 2.7.9+ #16
Comments
If you intend for this code to work in versions of Python < 2.7.9, please note that the |
@vladimir-v-diaz Ok, good to know, thanks for the comment. What do you suggest how to best tackle this issue? I guess, we might consider to stop supporting older Python versions at some point. |
Ideally, I'd recommend you drop support for Python < 2.7.9. In practice, that might not be possible. Seattle will probably support earlier versions of Python for the foreseeable future -- node operators are unlikely to upgrade outdated versions of Python that are installed? The quick fix: if python_version < 2.7.9:
# do what you do now
else:
# use the `context` argument with `xmlrpclib.ServerProxy` It might be better to actually test SSL connections... so use a certificate. It is easy with Python, not sure if it's possible in Seattle. |
Btw. the except clause, where I encountered this problem is not very verbose neither to the user nor to the developer. |
@vladimir-v-diaz, thanks for the heads-up. Indeed, we have to support older Python versions for the time being. This is a bit of pain in various places, and also one of the reasons we cannot expose HTTPS / SSL inside Repy sandboxes cleanly (although this would be a great piece of functionality!) @lukpueh, the |
Note: SeattleTestbed/clearinghouse#172 documents the silent blanket |
Thinking through my "sandbox" comment again .... there's actually no point using anything but the up-to-date Python 2 version for the clearinghouse. Backwards compatibility problems exist only for Seattle installs on nodes in the wild. Thus, @lukpueh's proposed patch (relying on the |
@vladimir-v-diaz @lukpueh Thanks guys! |
I think |
Sorry, I edited my previous reply to use the correct Python version of 2.7.9, instead of 2.5.9... |
This addresses a review comment that indirectly points out the ambiguity, SeattleTestbed/custominstallerbuilder#16 (comment) .
Addressed in SeattleTestbed/docs@3dbba8b by mentioning that the latest version of Python 2.7 should be used. |
Clearinghouse and Custominstallerbuilder use python's
xmlrpclib
to communicate with each other.xmlrpclib
in turn is based on python'shttplib
which was changed in Python 2.7.9+ to raise an exception during handshake when issuing a request via HTTPS and the server uses a self-signed certificate or theCommonName
of the certificate does not match the requested host. (c.f. PEP 474 for further background.)While this behavior is actually preferred in a production environment, it is a nuisance in a testing setup. Possible remedies are:
sign your certificates, e.g. with let's encrypt
Add an unverified ssl context to requests in debug mode, e.g. :
The text was updated successfully, but these errors were encountered: