Issue 810754: socket.ssl should check certificates (original) (raw)

Created on 2003-09-22 18:30 by gdamjan, last changed 2022-04-10 16:11 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
_ssl.c.patch gdamjan,2003-09-22 18:30
Messages (5)
msg44680 - (view) Author: Damjan Georgievski (gdamjan) Date: 2003-09-22 18:30
I've decided to post here the patch proposed by Ed Phillips, since I think it's simple addition to the socket.ssl that will drastically increase its usefullness... The point of the patch is for a socket.ssl object to check the certificate received by the peer. http://mail.python.org/pipermail/python-list/2003-July/174933.html
msg44681 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2003-10-26 16:47
Logged In: YES user_id=21627 I think you are mis-interpreting the purpose of the key_file and cert_file arguments. They do *not* indicate the certificate of the trusted CAs, but provide the key and certificate of the *client*. By re-interpreting the cert_file as the file of the trusted CAs, you break client-side authentication. Therefore, i reject this patch. That said, I do agree that checking server-side certificates is a useful think, so I encourage you to provide a new patch which does that, e.g. by adding a certificate_chain_file argument (or some such).
msg44682 - (view) Author: John Nagle (nagle) Date: 2006-11-30 20:10
This should be reopened. Just because the proposed fix didn't work is no reason to close the defect report. Currently, Python will accept the following totally bogus certificate (from www.amaison.co.uk) as valid: C = -- ST = SomeState L = SomeCity O = SomeOrganization OU = SomeOrganizationalUnit CN = localhost.localdomain emailAddress = root@localhost.localdomain Issuer identity: C = -- ST = SomeState L = SomeCity O = SomeOrganization OU = SomeOrganizationalUnit CN = localhost.localdomain emailAddress = root@localhost.localdomain
msg44683 - (view) Author: John Nagle (nagle) Date: 2006-11-30 20:18
Same bug, with different patch, is at: [ 1114345 ] Add SSL certificate validation
msg44684 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2006-11-30 20:43
This was a patch submission, asking that the proposed patch is integrated. I rejected the patch, and the issue is done. If you want to report a bug, please do so as a separate issue (you may include a patch also, but then the description should clearly state what the bug is - this issue doesn't). Of course, as a bug report, it may stay open unreviewed for several years if no patch is contributed that fixes it.
History
Date User Action Args
2022-04-10 16:11:17 admin set github: 39272
2003-09-22 18:30:17 gdamjan create