New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test_ssl fails in the macos CI #88109
Comments
|
Check out this build: https://github.com/python/cpython/pull/25584/checks?check_run_id=2437718845 Here, test_ssl fails in the macos CI target: 1 test failed: 20 tests skipped: server: bad connection attempt from ('127.0.0.1', 52404):
Traceback (most recent call last):
File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn
self.sslconn = self.server.context.wrap_socket(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket
return self.sslsocket_class._create(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create
self.do_handshake()
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake
self._sslobj.do_handshake()
OSError: [Errno 41] Protocol wrong type for socket
ERROR
test_connect_ex (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 52407)
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
ok
test_connect_fail (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 52409)
server: bad connection attempt from ('127.0.0.1', 52409):
Traceback (most recent call last):
File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn
self.sslconn = self.server.context.wrap_socket(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket
return self.sslsocket_class._create(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create
self.do_handshake()
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:969)
ok
test_connect_with_context (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 52411)
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
server: new connection from ('127.0.0.1', 52412)
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
server: new connection from ('127.0.0.1', 52413)
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
ok
test_connect_with_context_fail (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 52415)
server: bad connection attempt from ('127.0.0.1', 52415):
Traceback (most recent call last):
File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn
self.sslconn = self.server.context.wrap_socket(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket
return self.sslsocket_class._create(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create
self.do_handshake()
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:969)
ok
test_context_setget (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 52417)
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
ok
test_get_ca_certs_capath (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 52419)
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
ok
test_get_server_certificate (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 52422)
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
server: new connection from ('127.0.0.1', 52424)Verified certificate for localhost:52420 is server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) server: bad connection attempt from ('127.0.0.1', 52427):
Traceback (most recent call last):
File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn
self.sslconn = self.server.context.wrap_socket(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket
return self.sslsocket_class._create(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create
self.do_handshake()
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:969)
ok
test_get_server_certificate_sni (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 52430)
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
server: new connection from ('127.0.0.1', 52432)Verified certificate for localhost:52428 is server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) server: bad connection attempt from ('127.0.0.1', 52435):
Traceback (most recent call last):
File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn
self.sslconn = self.server.context.wrap_socket(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket
return self.sslsocket_class._create(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create
self.do_handshake()
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake
self._sslobj.do_handshake()
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:969)
ok
test_makefile_close (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 52437)
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
ok
test_non_blocking_connect_ex (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 52439)
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
ok
test_non_blocking_handshake (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 52441)Needed 2 calls to do_handshake() to establish session. server: bad connection attempt from ('127.0.0.1', 52471):
Traceback (most recent call last):
File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn
self.sslconn = self.server.context.wrap_socket(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket
return self.sslsocket_class._create(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create
self.do_handshake()
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: SSLV3_ALERT_BAD_CERTIFICATE] sslv3 alert bad certificate (_ssl.c:969)
ok
test_check_hostname_idn (test.test_ssl.ThreadedTests) ...
server: new connection from ('127.0.0.1', 52474)
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
server: new connection from ('127.0.0.1', 52476)
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
server: new connection from ('127.0.0.1', 52478)
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
server: new connection from ('127.0.0.1', 52480)
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
server: new connection from ('127.0.0.1', 52482)
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
server: new connection from ('127.0.0.1', 52484)
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
server: new connection from ('127.0.0.1', 52486)
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
server: new connection from ('127.0.0.1', 52488)
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
server: new connection from ('127.0.0.1', 52490)
server: bad connection attempt from ('127.0.0.1', 52490):
Traceback (most recent call last):
File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn
self.sslconn = self.server.context.wrap_socket(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket
return self.sslsocket_class._create(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create
self.do_handshake()
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: SSLV3_ALERT_BAD_CERTIFICATE] sslv3 alert bad certificate (_ssl.c:969)
ok
test_compression (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52492)
client: sending b'FOO\n'...
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
client: read b'foo\n'
client: sending b'FOO\n'...
client: read b'foo\n'
client: sending b'FOO\n'...
client: read b'foo\n'
client: closing connection.
got compression: None
ok
test_compression_disabled (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52494)
client: sending b'FOO\n'...
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
client: read b'foo\n'
client: sending b'FOO\n'...
client: read b'foo\n'
client: sending b'FOO\n'...
client: read b'foo\n'
client: closing connection.
ok
test_crl_check (test.test_ssl.ThreadedTests) ...
server: new connection from ('127.0.0.1', 52496)
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
server: new connection from ('127.0.0.1', 52498)
server: bad connection attempt from ('127.0.0.1', 52498):
Traceback (most recent call last):
File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn
self.sslconn = self.server.context.wrap_socket(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket
return self.sslsocket_class._create(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create
self.do_handshake()
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:969)
server: new connection from ('127.0.0.1', 52500)
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
ok
test_default_ecdh_curve (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52502)
server: connection cipher is now ('ECDHE-RSA-AES256-GCM-SHA384', 'TLSv1.2', 256)
ok
test_dh_params (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52504)
server: connection cipher is now ('DHE-RSA-AES256-GCM-SHA384', 'TLSv1.2', 256)
client: sending b'FOO\n'...
client: read b'foo\n'
client: sending b'FOO\n'...
client: read b'foo\n'
client: sending b'FOO\n'...
client: read b'foo\n'
client: closing connection.
ok
test_do_handshake_enotconn (test.test_ssl.ThreadedTests) ... ok
test_dual_rsa_ecc (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52506)
server: connection cipher is now ('ECDHE-ECDSA-AES256-GCM-SHA384', 'TLSv1.2', 256)
ok
test_ecc_cert (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52508)
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
ok
test_ecdh_curve (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52510)
client: sending b'FOO\n'...
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
client: read b'foo\n'
client: sending b'FOO\n'...
client: read b'foo\n'
client: sending b'FOO\n'...
client: read b'foo\n'
client: closing connection.
server: new connection from ('127.0.0.1', 52512)
client: sending b'FOO\n'...
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
client: read b'foo\n'
client: sending b'FOO\n'...
client: read b'foo\n'
client: sending b'FOO\n'...
client: read b'foo\n'
client: closing connection.
server: new connection from ('127.0.0.1', 52514)
server: bad connection attempt from ('127.0.0.1', 52514):
Traceback (most recent call last):
File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn
self.sslconn = self.server.context.wrap_socket(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket
return self.sslsocket_class._create(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create
self.do_handshake()
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: NO_SUITABLE_KEY_SHARE] no suitable key share (_ssl.c:969)
ok
test_echo (test.test_ssl.ThreadedTests)
Basic test of an SSL client connecting to a server ...
server: new connection from ('127.0.0.1', 52516)
client: sending b'FOO\n'...
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
client: read b'foo\n'
client: sending b'FOO\n'...
client: read b'foo\n'
client: sending b'FOO\n'...
client: read b'foo\n'
client: closing connection.
server: new connection from ('127.0.0.1', 52518)
server: bad connection attempt from ('127.0.0.1', 52518):
Traceback (most recent call last):
File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn
self.sslconn = self.server.context.wrap_socket(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket
return self.sslsocket_class._create(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create
self.do_handshake()
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL] called a function you should not call (_ssl.c:969)
server: new connection from ('127.0.0.1', 52520)
server: bad connection attempt from ('127.0.0.1', 52520):
Traceback (most recent call last):
File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn
self.sslconn = self.server.context.wrap_socket(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket
return self.sslsocket_class._create(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create
self.do_handshake()
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake
self._sslobj.do_handshake()
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:969)
server: new connection from ('127.0.0.1', 52522)
server: bad connection attempt from ('127.0.0.1', 52522):
Traceback (most recent call last):
File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn
self.sslconn = self.server.context.wrap_socket(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket
return self.sslsocket_class._create(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create
self.do_handshake()
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL] called a function you should not call (_ssl.c:969)
ok
test_getpeercert (test.test_ssl.ThreadedTests) ...
{'OCSP': ('http://testca.pythontest.net/testca/ocsp/',),
'caIssuers': ('http://testca.pythontest.net/testca/pycacert.cer',),
'crlDistributionPoints': ('http://testca.pythontest.net/testca/revocation.crl',),
'issuer': ((('countryName', 'XY'),),
(('organizationName', 'Python Software Foundation CA'),),
(('commonName', 'our-ca-server'),)),
'notAfter': 'Oct 28 14:23:16 2037 GMT',
'notBefore': 'Aug 29 14:23:16 2018 GMT',
'serialNumber': 'CB2D80995A69525C',
'subject': ((('countryName', 'XY'),),
(('localityName', 'Castle Anthrax'),),
(('organizationName', 'Python Software Foundation'),),
(('commonName', 'localhost'),)),
'subjectAltName': (('DNS', 'localhost'),),
'version': 3}
Connection cipher is ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256).
ok
test_getpeercert_enotconn (test.test_ssl.ThreadedTests) ... ok
test_handshake_timeout (test.test_ssl.ThreadedTests) ... ok
test_hostname_checks_common_name (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52529)
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
server: new connection from ('127.0.0.1', 52531)
server: bad connection attempt from ('127.0.0.1', 52531):
Traceback (most recent call last):
File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn
self.sslconn = self.server.context.wrap_socket(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket
return self.sslsocket_class._create(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create
self.do_handshake()
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: SSLV3_ALERT_BAD_CERTIFICATE] sslv3 alert bad certificate (_ssl.c:969)
ok
test_min_max_version_mismatch (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52533)
server: bad connection attempt from ('127.0.0.1', 52533):
Traceback (most recent call last):
File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn
self.sslconn = self.server.context.wrap_socket(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket
return self.sslsocket_class._create(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create
self.do_handshake()
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: UNSUPPORTED_PROTOCOL] unsupported protocol (_ssl.c:969)
ok
test_min_max_version_sslv3 (test.test_ssl.ThreadedTests) ... skipped 'SSLv3 is not available.'
test_min_max_version_tlsv1_1 (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52535)
server: connection cipher is now ('ECDHE-RSA-AES256-SHA', 'TLSv1.0', 256)
ok
test_min_max_version_tlsv1_2 (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52537)
server: connection cipher is now ('ECDHE-RSA-AES256-GCM-SHA384', 'TLSv1.2', 256)
ok
test_no_shared_ciphers (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52539)
server: bad connection attempt from ('127.0.0.1', 52539):
Traceback (most recent call last):
File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn
self.sslconn = self.server.context.wrap_socket(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket
return self.sslsocket_class._create(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create
self.do_handshake()
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: NO_SHARED_CIPHER] no shared cipher (_ssl.c:969)
ok
test_nonblocking_send (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52541)
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
Test server failure:
Traceback (most recent call last):
File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2491, in run
self.write(msg.lower())
File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2410, in write
return self.sslconn.write(bytes)
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1148, in write
return self._sslobj.write(data)
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:2286)
ok
test_npn_protocols (test.test_ssl.ThreadedTests) ... ok
test_protocol_sslv2 (test.test_ssl.ThreadedTests)
Connecting to an SSLv2 server with various client options ... skipped 'SSLv2 is not available.'
test_protocol_sslv3 (test.test_ssl.ThreadedTests)
Connecting to an SSLv3 server with various client options ... skipped 'SSLv3 is not available.'
test_protocol_tlsv1 (test.test_ssl.ThreadedTests)
Connecting to a TLSv1 server with various client options ...
PROTOCOL_TLSv1->PROTOCOL_TLSv1 CERT_NONE
PROTOCOL_TLSv1->PROTOCOL_TLSv1 CERT_OPTIONAL
PROTOCOL_TLSv1->PROTOCOL_TLSv1 CERT_REQUIRED
{PROTOCOL_TLS->PROTOCOL_TLSv1} CERT_NONE
ok
test_protocol_tlsv1_1 (test.test_ssl.ThreadedTests)
Connecting to a TLSv1.1 server with various client options. ...
PROTOCOL_TLSv1_1->PROTOCOL_TLSv1_1 CERT_NONE
{PROTOCOL_TLS->PROTOCOL_TLSv1_1} CERT_NONE
PROTOCOL_TLSv1_1->PROTOCOL_TLS CERT_NONE
{PROTOCOL_TLSv1_2->PROTOCOL_TLSv1_1} CERT_NONE
{PROTOCOL_TLSv1_1->PROTOCOL_TLSv1_2} CERT_NONE
ok
test_protocol_tlsv1_2 (test.test_ssl.ThreadedTests)
Connecting to a TLSv1.2 server with various client options. ...
PROTOCOL_TLSv1_2->PROTOCOL_TLSv1_2 CERT_NONE
{PROTOCOL_TLS->PROTOCOL_TLSv1_2} CERT_NONE
PROTOCOL_TLSv1_2->PROTOCOL_TLS CERT_NONE
{PROTOCOL_TLSv1->PROTOCOL_TLSv1_2} CERT_NONE
{PROTOCOL_TLSv1_2->PROTOCOL_TLSv1} CERT_NONE
{PROTOCOL_TLSv1_1->PROTOCOL_TLSv1_2} CERT_NONE
{PROTOCOL_TLSv1_2->PROTOCOL_TLSv1_1} CERT_NONE
ok
test_read_write_after_close_raises_valuerror (test.test_ssl.ThreadedTests) ... ok
test_recv_send (test.test_ssl.ThreadedTests)
Test recv(), send() and friends. ...
server: new connection from ('127.0.0.1', 52577)
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
ok
test_recv_zero (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52580)
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
ok
test_rude_shutdown (test.test_ssl.ThreadedTests)
A brutal shutdown of an SSL server should raise an OSError ... ok
test_selected_alpn_protocol (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52584)
client: sending b'FOO\n'...
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
client: read b'foo\n'
client: sending b'FOO\n'...
client: read b'foo\n'
client: sending b'FOO\n'...
client: read b'foo\n'
client: closing connection.
ok
test_selected_alpn_protocol_if_server_uses_alpn (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52586)
client: sending b'FOO\n'...
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
client: read b'foo\n'
client: sending b'FOO\n'...
client: read b'foo\n'
client: sending b'FOO\n'...
client: read b'foo\n'
client: closing connection.
ok
test_sendfile (test.test_ssl.ThreadedTests) ... ok
test_server_accept (test.test_ssl.ThreadedTests) ... ok
test_session (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52592)
server: connection cipher is now ('ECDHE-RSA-AES256-GCM-SHA384', 'TLSv1.2', 256)
server: new connection from ('127.0.0.1', 52594)
server: connection cipher is now ('ECDHE-RSA-AES256-GCM-SHA384', 'TLSv1.2', 256)
server: new connection from ('127.0.0.1', 52596)
server: connection cipher is now ('ECDHE-RSA-AES256-GCM-SHA384', 'TLSv1.2', 256)
server: new connection from ('127.0.0.1', 52598)
server: connection cipher is now ('ECDHE-RSA-AES256-GCM-SHA384', 'TLSv1.2', 256)
ok
test_session_handling (test.test_ssl.ThreadedTests) ... ok
test_shared_ciphers (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52604)
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
ok
test_sni_callback (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52606)
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
server: new connection from ('127.0.0.1', 52608)
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
server: new connection from ('127.0.0.1', 52610)
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
ok
test_sni_callback_alert (test.test_ssl.ThreadedTests) ... ok
test_sni_callback_raising (test.test_ssl.ThreadedTests) ... ok
test_sni_callback_wrong_return_type (test.test_ssl.ThreadedTests) ... ok
test_socketserver (test.test_ssl.ThreadedTests)
Using socketserver to create and manage SSL connections. ...
server (('127.0.0.1', 52617):52617 ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)):
[26/Apr/2021 11:43:19] "GET /keycert.pem HTTP/1.1" 200 -
client: read 4058 bytes from remote server '<HTTPSServerThread <HTTPSServer 1.0.0.127.in-addr.arpa:52617>>'
stopping HTTPS server
joining HTTPS thread
ok
test_ssl_cert_verify_error (test.test_ssl.ThreadedTests) ...
server: new connection from ('127.0.0.1', 52621)
server: bad connection attempt from ('127.0.0.1', 52621):
Traceback (most recent call last):
File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn
self.sslconn = self.server.context.wrap_socket(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket
return self.sslsocket_class._create(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create
self.do_handshake()
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:969)
ok
test_starttls (test.test_ssl.ThreadedTests)
Switching from clear text to encrypted and back again. ...
client: sending b'msg 1'...
server: new connection from ('127.0.0.1', 52623)
server: read b'msg 1' (unencrypted), sending back b'msg 1' (unencrypted)...
client: read b'msg 1' from server
client: sending b'MSG 2'...
server: read b'MSG 2' (unencrypted), sending back b'msg 2' (unencrypted)...
client: read b'msg 2' from server
client: sending b'STARTTLS'...
server: read STARTTLS from client, sending OK...
client: read b'ok' from server, starting TLS...
client: sending b'MSG 3'...
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
server: read b'MSG 3' (encrypted), sending back b'msg 3' (encrypted)...
client: read b'msg 3' from server
client: sending b'msg 4'...
server: read b'msg 4' (encrypted), sending back b'msg 4' (encrypted)...
client: read b'msg 4' from server
client: sending b'ENDTLS'...
server: read ENDTLS from client, sending OK...
client: read b'ok' from server, ending TLS...
client: sending b'msg 5'...
server: connection is now unencrypted...
server: read b'msg 5' (unencrypted), sending back b'msg 5' (unencrypted)...
client: read b'msg 5' from server
client: sending b'msg 6'...
server: read b'msg 6' (unencrypted), sending back b'msg 6' (unencrypted)...
client: read b'msg 6' from server
client: closing connection.
server: client closed connection
ok
test_tls1_3 (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52625)
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
ok
test_tls_unique_channel_binding (test.test_ssl.ThreadedTests)
Test tls-unique channel binding. ...
server: new connection from ('127.0.0.1', 52627)
got channel binding data: b'\xb6\xc4\x94=\xb1\xc0\xe1\x05\xbd\x803\xd1\xec\x14,\x95\x8d\xbe!\xbf\xa6\x93\x06)\xc0(U\r\x8d\xdcA\xe9\xa2\xef\xae*6\xa8\xb5~;\x8f\xd9\xa6\x141x\xa2'
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
server: new connection from ('127.0.0.1', 52628)
got another channel binding data: b'N1\xb3OAX\xaa\x05dD/~\x8a\xcbM\xf3\x1b\x1a<\x98:\xb9\x80\xf6b\xe3\x1a\x0e\x9e\xf6\x87\xde\xfc\xfc\xc4\x93t\x90a\xb7\xa6O\xdf\xcc\x10\xdf?y'
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
ok
test_version_basic (test.test_ssl.ThreadedTests)
Basic tests for SSLSocket.version(). ... ok
test_wrong_cert_tls12 (test.test_ssl.ThreadedTests)
Connecting when the server rejects the client's certificate ... server: new connection from ('127.0.0.1', 52632)SSLError is SSLError(1, '[SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:969)') server: bad connection attempt from ('127.0.0.1', 52632):
Traceback (most recent call last):
File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn
self.sslconn = self.server.context.wrap_socket(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket
return self.sslsocket_class._create(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create
self.do_handshake()
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:969)
ok
test_wrong_cert_tls13 (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52634)SSLError is SSLError(1, '[SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:2438)') server: bad connection attempt from ('127.0.0.1', 52634):
Traceback (most recent call last):
File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn
self.sslconn = self.server.context.wrap_socket(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket
return self.sslsocket_class._create(
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create
self.do_handshake()
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:969)
ok
test_bpo37428_pha_cert_none (test.test_ssl.TestPostHandshakeAuth) ... ok
test_pha_no_pha_client (test.test_ssl.TestPostHandshakeAuth) ... ok
test_pha_no_pha_server (test.test_ssl.TestPostHandshakeAuth) ... ok
test_pha_not_tls13 (test.test_ssl.TestPostHandshakeAuth) ... ok
test_pha_optional (test.test_ssl.TestPostHandshakeAuth) ...
ok
test_pha_optional_nocert (test.test_ssl.TestPostHandshakeAuth) ...
ok
test_pha_required (test.test_ssl.TestPostHandshakeAuth) ... ok
test_pha_required_nocert (test.test_ssl.TestPostHandshakeAuth) ... server: new connection from ('127.0.0.1', 52650)
client cert is None
client did not provide a cert
server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)
TLS: (<ssl.SSLSocket fd=7, family=AF_INET, type=SOCK_STREAM, proto=0, laddr=('127.0.0.1', 52649), raddr=('127.0.0.1', 52650)>, 'write', TLSVersion.TLSv1_3, _TLSContentType.ALERT, _TLSAlertType.CERTIFICATE_REQUIRED, b'\x02t')
TLS: (<ssl.SSLSocket fd=6, family=AF_INET, type=SOCK_STREAM, proto=0, laddr=('127.0.0.1', 52650), raddr=('127.0.0.1', 52649)>, 'read', TLSVersion.TLSv1_3, _TLSContentType.ALERT, _TLSAlertType.CERTIFICATE_REQUIRED, b'\x02t')
Test server failure:
Traceback (most recent call last):
File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2427, in run
msg = self.read()
File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2404, in read
return self.sslconn.read()
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1131, in read
return self._sslobj.read(len)
ssl.SSLError: [SSL: PEER_DID_NOT_RETURN_A_CERTIFICATE] peer did not return a certificate (_ssl.c:2438)
ok
test_pha_setter (test.test_ssl.TestPostHandshakeAuth) ... ok
test_keylog_defaults (test.test_ssl.TestSSLDebug) ... ok
test_keylog_env (test.test_ssl.TestSSLDebug) ... skipped 'test is not compatible with ignore_environment'
test_keylog_filename (test.test_ssl.TestSSLDebug) ... ok
test_msg_callback (test.test_ssl.TestSSLDebug) ... ok
test_msg_callback_deadlock_bpo43577 (test.test_ssl.TestSSLDebug) ... ok
test_msg_callback_tls12 (test.test_ssl.TestSSLDebug) ... ok
test_get_server_certificate_ipv6 (test.test_ssl.NetworkedTests) ... skipped "Resource 'ipv6.google.com' is not available"
test test_ssl failed
test_timeout_connect_ex (test.test_ssl.NetworkedTests) ... ok====================================================================== Traceback (most recent call last):
File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2045, in test_connect_capath
s.connect(self.server_addr)
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1372, in connect
self._real_connect(addr, False)
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1363, in _real_connect
self.do_handshake()
File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake
self._sslobj.do_handshake()
ConnectionResetError: [Errno 54] Connection reset by peerRan 164 tests in 29.112s FAILED (errors=1, skipped=10) |
|
I have seen the test fail before. It seems to be flaky on macOS but it fails only very rarely. |
Unfortunately, in #25584 it has failed 3 times in a row. That's why I decided to open the issue. Let me re-run again. |
|
I'm still unsure why tests are sometimes failing. Test fail rarely on macOS and Windows. When tests are failing it's usually a bunch of tests that fail with "connection reset by peer". I suspect that the listener backlog and timeout of the server socket is too aggressive. |
|
fingers crossed! |
|
Fixed by #25850 |


Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: