Martin Panter added the comment:

There are more mistakes in the history of test_nonexisting_cert(). In revision 
8a281bfc058d (Python 2.6), the method was added as testWrongCert(), with an 
existing but non-matching certificate file. But when this was ported to Python 
3 in r66311, the wrongcert.pem file was not added, so Python 3 was actually 
testing the behaviour when the specified certificate file was missing. Then in 
r80596, the test method was renamed and a comment added assuming the Python 3 
version with the missing file. However we already test the behaviour of missing 
files in test_errors().

I do not understand the ECONNRESET failure on Windows. Perhaps there is a race 
to do with the server closing the connection when the client should be 
reporting a certificate mismatch. It seems like a bug, and I suspect r80534 is 
not the correct fix. But Iā€™m not in a position to investigate so I will leave 
that code as it is.

For Python 2 I propose wrong-cert-py2.patch:

* Rename WRONGCERT ā†’ NONEXISTINGCERT, not to be confused with wrongcert.pem
* Repurpose test_nonexisting_cert() ā†’ test_wrong_cert()
* Remove ENOENT exception handling from bad_cert_test()

----------
Added file: http://bugs.python.org/file41735/wrong-cert-py2.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26173>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to