Issue2774

classification
Title: test_ssl failures from weak certificate
Type: behaviour Severity: normal
Components: Versions: Jython 2.7
Milestone: Jython 2.7.2
process
Status: pending Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: adamburke, jeff.allen
Priority: normal Keywords:

Created on 2019-05-23.05:47:27 by adamburke, last changed 2019-06-16.18:08:51 by jeff.allen.

Messages
msg12530 (view) Author: Adam Burke (adamburke) Date: 2019-05-23.05:47:26
Example from Travis 
https://travis-ci.org/jythontools/jython/jobs/535576707

     [exec] Re-running test 'test_ssl' in verbose mode
     [exec] test_ssl: testing with 'OpenSSL 1.0.0 (as emulated by Java SSL)' (1, 0, 0, 0, 0)
     [exec]           under Linux ('debian', 'jessie/sid', '')
     [exec]           HAS_SNI = True
     [exec]           OP_ALL = 0x       0
     [exec] 
     [exec]  RAND_status is 1 (sufficient randomness)
     [exec] [Errno 1] certificate verify failed (javax.net.ssl.SSLHandshakeException: General SSLEngine problem)
     [exec] 
     [exec] Needed 1 calls to do_handshake() to establish session.
     [exec] test test_ssl failed -- multiple errors occurred

Example locally

======================================================================
ERROR: test_connect_with_context (test.test_ssl.NetworkedTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\Adam\jython\jython8\jython\dist\Lib\test\test_ssl.py", line 1552, in test_connect_with_context
    s.connect((REMOTE_HOST, 443))
  File "C:\Users\Adam\jython\jython8\jython\dist\Lib\ssl.py", line 621, in connect
    self.do_handshake()
  File "C:\Users\Adam\jython\jython8\jython\dist\Lib\ssl.py", line 691, in do_handshake
    self._sock._handle_channel_future(self._handshake_future, "SSL handshake")
  File "C:\Users\Adam\jython\jython8\jython\dist\Lib\_socket.py", line 384, in handle_exception
    raise _map_exception(jlx)
SSLError: [Errno 1] certificate verify failed (java.security.cert.CertificateException: certificate verify failed)

See similar Python bug https://bugs.python.org/issue36816 and commit 7b5dca8345f4a909367836a3a2c3c7ac6e4e2c0c
msg12534 (view) Author: Adam Burke (adamburke) Date: 2019-05-24.00:41:53
PR https://github.com/jythontools/jython/pull/143
msg12558 (view) Author: Jeff Allen (jeff.allen) Date: 2019-06-16.18:08:51
Fixed at: https://hg.python.org/jython/rev/3d37bb31d66d

Thanks Adam!
History
Date User Action Args
2019-06-16 18:08:51jeff.allensetstatus: open -> pending
priority: normal
type: behaviour
title: test_ssl failures on Travis -> test_ssl failures from weak certificate
nosy: + jeff.allen
milestone: Jython 2.7.2
messages: + msg12558
resolution: fixed
2019-05-24 00:41:53adamburkesetmessages: + msg12534
2019-05-23 05:47:27adamburkecreate