-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
self-signed.pythontest.net TLS certificate key is too weak #80997
Comments
test_httplib uses self-signed.pythontest.net in it's test_networked_good_cert test. On modern Linux distros (current Debian testing sid), the certificate it currently uses is rightfully rejected as being too weak: ERROR: test_networked_good_cert (test.test_httplib.HTTPSTest) Traceback (most recent call last):
File "/home/greg/oss/cpython/Lib/test/test_httplib.py", line 1628, in test_networked_good_cert
h.request('GET', '/')
File "/home/greg/oss/cpython/Lib/http/client.py", line 1221, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/home/greg/oss/cpython/Lib/http/client.py", line 1267, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/home/greg/oss/cpython/Lib/http/client.py", line 1216, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/home/greg/oss/cpython/Lib/http/client.py", line 1004, in _send_output
self.send(msg)
File "/home/greg/oss/cpython/Lib/http/client.py", line 944, in send
self.connect()
File "/home/greg/oss/cpython/Lib/http/client.py", line 1383, in connect
self.sock = self._context.wrap_socket(self.sock,
File "/home/greg/oss/cpython/Lib/ssl.py", line 405, in wrap_socket
return self.sslsocket_class._create(
File "/home/greg/oss/cpython/Lib/ssl.py", line 853, in _create
self.do_handshake()
File "/home/greg/oss/cpython/Lib/ssl.py", line 1117, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: EE certificate key too weak (_ssl.c:1055) The TLS certificate on the server needs to be updated to something modern. I _believe_ this can be done by someone with infrastructure access via an update to https://github.com/python/pythontestdotnet/tree/master/tls Assigning to EWDurbin for triage and redirection to someone else infrastructury if he's not the right person. How to know if it has been fixed? Monitor the test_networked_good_cert test on any "Debian buster" builtbot(s) such as https://buildbot.python.org/all/#/workers/23 to make sure it is not skipped. (the test _currently_ fails, I am going to have it be _skipped_ on this specific key too small error for the time being to get that stable buildbot green again) |
EWDurbin says I can just open a PR with new certs in the repo and it'll go from there. :) |
Updated cert+key committed to pythontestdotnet. reassigning to EWDurbin to see that they're deployed. |
Cert updated, reassigning back to gregory.p.smith to verify and close this out. |
Lib/test/selfsigned_pythontestdotnet.pem in the cpython repository needs to be updated to match https://github.com/python/pythontestdotnet/blob/master/tls/self-signed-cert.pem, or the test fails :) ====================================================================== Traceback (most recent call last):
File "/home/yen/tmp/cpython/Lib/test/test_httplib.py", line 1632, in test_networked_good_cert
h.request('GET', '/')
File "/home/yen/tmp/cpython/Lib/http/client.py", line 1221, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/home/yen/tmp/cpython/Lib/http/client.py", line 1267, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/home/yen/tmp/cpython/Lib/http/client.py", line 1216, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/home/yen/tmp/cpython/Lib/http/client.py", line 1004, in _send_output
self.send(msg)
File "/home/yen/tmp/cpython/Lib/http/client.py", line 944, in send
self.connect()
File "/home/yen/tmp/cpython/Lib/http/client.py", line 1383, in connect
self.sock = self._context.wrap_socket(self.sock,
File "/home/yen/tmp/cpython/Lib/ssl.py", line 405, in wrap_socket
return self.sslsocket_class._create(
File "/home/yen/tmp/cpython/Lib/ssl.py", line 853, in _create
self.do_handshake()
File "/home/yen/tmp/cpython/Lib/ssl.py", line 1117, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1055) |
I am not an OpenSSL expert - and I am conscious of OpenSSL changes with regard to 'acceptance' of anything self-signed. And, what it looks like you are trying to do with an updated 'signing" .pem is to remove the 'self-signed' charasteric. On AIX - atm - I get, as did Chih-Hsuan Yen (yan12125), ====================================================================== Traceback (most recent call last):
File "/home/buildbot/python-master/Lib/test/test_httplib.py", line 1632, in test_networked_good_cert
h.request('GET', '/')
File "/home/buildbot/python-master/Lib/http/client.py", line 1221, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/home/buildbot/python-master/Lib/http/client.py", line 1267, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/home/buildbot/python-master/Lib/http/client.py", line 1216, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/home/buildbot/python-master/Lib/http/client.py", line 1004, in _send_output
self.send(msg)
File "/home/buildbot/python-master/Lib/http/client.py", line 944, in send
self.connect()
File "/home/buildbot/python-master/Lib/http/client.py", line 1383, in connect
self.sock = self._context.wrap_socket(self.sock,
File "/home/buildbot/python-master/Lib/ssl.py", line 405, in wrap_socket
return self.sslsocket_class._create(
File "/home/buildbot/python-master/Lib/ssl.py", line 853, in _create
self.do_handshake()
File "/home/buildbot/python-master/Lib/ssl.py", line 1117, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1055) And I see why now: Digging a bit: buildbot@x064:[/home/buildbot/python-master]openssl s_client -connect self-signed.pythontest.net:443 i:/C=XY/ST=Castle Anthrax/L=Argument Clinic/O=Python Software Foundation/CN=self-signed.pythontest.net And while this: is nice for some, it is not nice for all! Perhaps the test should be switched to 'warn' on failure, rather than error on failure, until fixed! |
p.s. On Centos I could not even get a python3 (at least not easily). On debian (on POWER) I get the same error (message) as on AIX - although the line number did change. ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1056) so, not a message about "key too small error" - pure, this is self-signed, so error. |
On 21/05/2019 12:08, Michael Felt wrote:
|
Hi Michael Felt,
If I understand it correctly, the new certificate is indeed still self-signed. It's updated to match the certificate deployed at https://self-signed.pythontest.net/. Under the hood load_verify_locations() at line 1628 is used to make the test accept any valid certificate signed with the given certificate. As a record, with CPython e7cb23b and OpenSSL 1.1.1b on Arch Linux x86_64, the test is green: test_networked_good_cert (test.test_httplib.HTTPSTest) ... ok By the way, I believe the "key too weak" workaround can be removed now and then this issue can be closed. |
I believe this has been addressed. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: