Author vstinner
Recipients benjamin.peterson, christian.heimes, cstratak, mscastanho, vstinner
Date 2020-03-23.14:52:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I closed bpo-39787 "test_ssl and test_urllib2_localnet failing with new OpenSSL" as a duplicate of this issue. Copy of the message:

test_ssl and test_urllib2_localnet are failing when Python is built against top-of-tree OpenSSL. I'm attaching the output of: ` test_ssl test_urllib2_localnet -W`

The output is from a powerpc64le machine with Python 3.8.2+ (1bbb81b251bc) and OpenSSL master (db943f43a60d1b).

A git bisect showed the problems started with the following OpenSSL commit:

commit db943f43a60d1b5b1277e4b5317e8f288e7a0a3a
Author: Matt Caswell <>
Date:   Fri Jan 17 17:39:19 2020 +0000

    Detect EOF while reading in libssl
    If we hit an EOF while reading in libssl then we will report an error
    back to the application (SSL_ERROR_SYSCALL) but errno will be 0. We add
    an error to the stack (which means we instead return SSL_ERROR_SSL) and
    therefore give a hint as to what went wrong.
    Contains a partial fix for #10880
    Reviewed-by: Tomas Mraz <>
    Reviewed-by: Dmitry Belyavskiy <>
    (Merged from

This also looks similar to:

There is a file attached which contains test failures like these ones:

test_ciphers (test.test_ssl.SimpleBackgroundTests) ...  server:  new connection from ('', 39550)
 server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
 server: selected protocol is now None
Test server failure:
Traceback (most recent call last):
   File "/home/mscastanho/AT/next/opt/at-next-14.0-0-alpha/lib64/python3.8/test/", line 2388, in run
    msg =
   File "/home/mscastanho/AT/next/opt/at-next-14.0-0-alpha/lib64/python3.8/test/", line 2365, in read
   File "/home/mscastanho/AT/next/opt/at-next-14.0-0-alpha/lib64/python3.8/", line 1101, in read
 OSError: [Errno 0] Error

ERROR: test_connect_capath (test.test_ssl.SimpleBackgroundTests)
Traceback (most recent call last):
  File "/home/mscastanho/AT/next/opt/at-next-14.0-0-alpha/lib64/python3.8/test/", line 2038, in test_connect_capath
  File "/home/mscastanho/AT/next/opt/at-next-14.0-0-alpha/lib64/python3.8/", line 1342, in connect
    self._real_connect(addr, False)
  File "/home/mscastanho/AT/next/opt/at-next-14.0-0-alpha/lib64/python3.8/", line 1333, in _real_connect
  File "/home/mscastanho/AT/next/opt/at-next-14.0-0-alpha/lib64/python3.8/", line 1309, in do_handshake
ConnectionResetError: [Errno 104] Connection reset by peer

ERROR: test_https (test.test_urllib2_localnet.TestUrlopen)
Traceback (most recent call last):
  File "/home/mscastanho/AT/next/opt/at-next-14.0-0-alpha/lib64/python3.8/test/", line 560, in test_https
    data = self.urlopen("https://localhost:%s/bizarre" % handler.port, context=context)
  File "/home/mscastanho/AT/next/opt/at-next-14.0-0-alpha/lib64/python3.8/test/", line 464, in urlopen
  File "/home/mscastanho/AT/next/opt/at-next-14.0-0-alpha/lib64/python3.8/http/", line 655, in readline
    result = self.fp.readline(limit)
  File "/home/mscastanho/AT/next/opt/at-next-14.0-0-alpha/lib64/python3.8/", line 669, in readinto
    return self._sock.recv_into(b)
  File "/home/mscastanho/AT/next/opt/at-next-14.0-0-alpha/lib64/python3.8/", line 1241, in recv_into
    return, buffer)
  File "/home/mscastanho/AT/next/opt/at-next-14.0-0-alpha/lib64/python3.8/", line 1099, in read
    return, buffer)
ssl.SSLError: [SSL: KRB5_S_TKT_NYV] unexpected eof while reading (_ssl.c:2607)
Date User Action Args
2020-03-23 14:52:54vstinnersetrecipients: + vstinner, christian.heimes, benjamin.peterson, cstratak, mscastanho
2020-03-23 14:52:54vstinnersetmessageid: <>
2020-03-23 14:52:54vstinnerlinkissue40018 messages
2020-03-23 14:52:54vstinnercreate