This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: ssl.SSLError exceptions in test_poplib
Type: crash Stage: resolved
Components: asyncio Versions: Python 3.7
Status: closed Resolution: duplicate
Dependencies: Superseder: test_check_hostname() of test_ftplib started to fail randomly
View: 32706
Assigned To: Nosy List: asvetlov, christian.heimes, methane, r.david.murray, yarkot
Priority: normal Keywords:

Created on 2018-02-02 23:07 by yarkot, last changed 2022-04-11 14:58 by admin. This issue is now closed.

File name Uploaded Description Edit
v3.7.0b1-test-failure.txt yarkot, 2018-02-02 23:07 terminal capture of test suite failure point.
Messages (4)
msg311521 - (view) Author: Yarko Tymciurak (yarkot) Date: 2018-02-02 23:07
Just built v3.7.0b1, and have the following test hangs (see attached).

My build is on Ubuntu 16.04;  lsb_release -a output:

LSB Version:	core-9.20160110ubuntu0.2-amd64:core-9.20160110ubuntu0.2-noarch:printing-9.20160110ubuntu0.2-amd64:printing-9.20160110ubuntu0.2-noarch:security-9.20160110ubuntu0.2-amd64:security-9.20160110ubuntu0.2-noarch
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.3 LTS
Release:	16.04
Codename:	xenial

My "usual" config / build process:

$ make distclean
$ ./configure --enable-shared --enable-loadable-sqlite-extensions --with-system-ffi --with-ensurepip=upgrade --enable-optimizations
$ make -j

I have been building 3.7 weekly, from master, and I've never seen anything like this before.
msg311522 - (view) Author: Yarko Tymciurak (yarkot) Date: 2018-02-02 23:14
...also, my initial build (after inspecting git log) was from (as I usually do) master/HEAD;

To check that this was indeed from v3.7.0b1 release, I `distclean` and checked out the v3.7.0b1 tag, and rebuilt.   (Looks like same error / behavior).
msg311617 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2018-02-04 19:40
It's a duplicate of #32706. The new cert validation code causes the handshake to terminate properly. The old asyncore based test routine is not able to handle this correctly when the machine is under heavy load.
msg315125 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2018-04-09 11:49
On Ubuntu 17.10 (OpenSSL 1.0.2g), this patch fixes test_poplib error.
But I don't know this patch is right.

$ git diff
diff --git a/Lib/test/ b/Lib/test/
index 6abdc93879..d7a8857b05 100644
--- a/Lib/test/
+++ b/Lib/test/
@@ -180,7 +180,8 @@ class DummyPOP3Handler(asynchat.async_chat):
                 elif err.args[0] == ssl.SSL_ERROR_EOF:
                     return self.handle_close()
                 # TODO: SSLError does not expose alert information
-                elif "SSLV3_ALERT_BAD_CERTIFICATE" in err.args[1]:
+                elif ("SSLV3_ALERT_BAD_CERTIFICATE" in err.args[1]
+                        or "SSLV3_ALERT_CERTIFICATE_UNKNOWN" in err.args[1]):
                     return self.handle_close()
             except OSError as err:
Date User Action Args
2022-04-11 14:58:57adminsetgithub: 76934
2018-04-09 11:49:31methanesetnosy: + methane
messages: + msg315125
2018-02-04 19:40:19christian.heimessetstatus: open -> closed
superseder: test_check_hostname() of test_ftplib started to fail randomly
messages: + msg311617

resolution: duplicate
stage: resolved
2018-02-02 23:21:48yselivanovsetnosy: - yselivanov
2018-02-02 23:14:23yarkotsetmessages: + msg311522
2018-02-02 23:11:16r.david.murraysetnosy: + r.david.murray
2018-02-02 23:11:06r.david.murraysetnosy: + christian.heimes
2018-02-02 23:07:56yarkotcreate