[issue32753] ssl.SSLError exceptions in test_poplib

INADA Naoki report at bugs.python.org
Mon Apr 9 07:49:31 EDT 2018


INADA Naoki <songofacandy at gmail.com> added the comment:

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/test_poplib.py b/Lib/test/test_poplib.py
index 6abdc93879..d7a8857b05 100644
--- a/Lib/test/test_poplib.py
+++ b/Lib/test/test_poplib.py
@@ -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()
                 raise
             except OSError as err:

----------
nosy: +inada.naoki

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32753>
_______________________________________


More information about the Python-bugs-list mailing list