test_sslwrap_simple (__main__.BasicTests) ... ok test_DER_to_PEM (__main__.BasicSocketTests) ... ok test_ciphers (__main__.BasicSocketTests) ... ok test_constants (__main__.BasicSocketTests) ... ok test_openssl_version (__main__.BasicSocketTests) ... FAIL test_parse_cert (__main__.BasicSocketTests) ... {'notAfter': 'Oct 5 23:01:56 2020 GMT', 'subject': ((('countryName', u'XY'),), (('localityName', u'Castle Anthrax'),), (('organizationName', u'Python Software Foundation'),), (('commonName', u'localhost'),)), 'subjectAltName': (('DNS', 'localhost'),)} {'issuer': ((('countryName', u'US'),), (('organizationName', u'VeriSign, Inc.'),), (('organizationalUnitName', u'VeriSign Trust Network'),), (('organizationalUnitName', u'Terms of use at https://www.verisign.com/rpa (c)10'),), (('commonName', u'VeriSign Class 3 International Server CA - G3'),)), 'notAfter': 'Sep 20 23:59:59 2012 GMT', 'notBefore': 'Sep 21 00:00:00 2011 GMT', 'serialNumber': '2EE6EA7640A075CEE5005F4D7C79549A', 'subject': ((('countryName', u'FI'),), (('stateOrProvinceName', u'Espoo'),), (('localityName', u'Espoo'),), (('organizationName', u'Nokia'),), (('organizationalUnitName', u'BI'),), (('commonName', u'projects.developer.nokia.com'),)), 'subjectAltName': (('DNS', 'projects.developer.nokia.com'), ('DNS', 'projects.forum.nokia.com')), 'version': 3} ok test_parse_cert_CVE_2013_4238 (__main__.BasicSocketTests) ... {'issuer': ((('countryName', u'US'),), (('stateOrProvinceName', u'Oregon'),), (('localityName', u'Beaverton'),), (('organizationName', u'Python Software Foundation'),), (('organizationalUnitName', u'Python Core Development'),), (('commonName', u'null.python.org\x00example.org'),), (('emailAddress', u'python-dev@python.org'),)), 'notAfter': 'Aug 7 13:12:52 2013 GMT', 'notBefore': 'Aug 7 13:11:52 2013 GMT', 'serialNumber': '00', 'subject': ((('countryName', u'US'),), (('stateOrProvinceName', u'Oregon'),), (('localityName', u'Beaverton'),), (('organizationName', u'Python Software Foundation'),), (('organizationalUnitName', u'Python Core Development'),), (('commonName', u'null.python.org\x00example.org'),), (('emailAddress', u'python-dev@python.org'),)), 'subjectAltName': (('DNS', 'altnull.python.org\x00example.com'), ('email', 'null@python.org\x00user@example.org'), ('URI', 'http://null.python.org\x00http://example.org'), ('IP Address', '192.0.2.1'), ('IP Address', '2001:DB8:0:0:0:0:0:1\n')), 'version': 3} ok test_random (__main__.BasicSocketTests) ... RAND_status is 1 (sufficient randomness) ok test_refcycle (__main__.BasicSocketTests) ... ok test_unsupported_dtls (__main__.BasicSocketTests) ... ok test_wrapped_unconnected (__main__.BasicSocketTests) ... ok test_algorithms (__main__.NetworkedTests) ... skipped 'remote host needs SNI, only available on Python 3.2+' test_connect (__main__.NetworkedTests) ... ok test_connect_ex (__main__.NetworkedTests) ... ok test_connect_ex_error (__main__.NetworkedTests) ... ok test_get_server_certificate (__main__.NetworkedTests) ... Verified certificate for svn.python.org:443 is -----BEGIN CERTIFICATE----- MIIEzzCCAregAwIBAgIDDkGJMA0GCSqGSIb3DQEBBQUAMHkxEDAOBgNVBAoTB1Jv b3QgQ0ExHjAcBgNVBAsTFWh0dHA6Ly93d3cuY2FjZXJ0Lm9yZzEiMCAGA1UEAxMZ Q0EgQ2VydCBTaWduaW5nIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJARYSc3VwcG9y dEBjYWNlcnQub3JnMB4XDTEzMTIyNDIwMjgzMloXDTE1MTIyNDIwMjgzMlowGTEX MBUGA1UEAxMOc3ZuLnB5dGhvbi5vcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw ggEKAoIBAQDM6un3wTW9+HVJ7KC+/GwL0KAxehug0tw2YoSSX+TGxLyr9AUtBHQk hCNWhRLewa0WMOY6hxIIQY1Hp6vreDiCbBehjVkEAydlKBzaAsgYCEbCC/ZaMzhv aaFAiLVeaxAKJsBGUJNz5hGgzd67A6SGz+XK7qDWig4NR5eFrsr3DvjyEM7txMiG gftGWLkadOuqUQsI20AykBGi+RxmrQIwqO2svGmje89DsWVILdP37PssM2zqRonh 4fUKooei3L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----END CERTIFICATE----- ok test_makefile_close (__main__.NetworkedTests) ... ok test_non_blocking_connect_ex (__main__.NetworkedTests) ... ok test_non_blocking_handshake (__main__.NetworkedTests) ... Needed 3 calls to do_handshake() to establish session. ok test_timeout_connect_ex (__main__.NetworkedTests) ... ok test_asyncore_server (__main__.ThreadedTests) Check the example asyncore integration. ... server: new connection from 172.17.2.201:19104 client: sending 'TEST MESSAGE of mixed case\n'... client: read 'test message of mixed case\n' client: closing connection. cleanup: stopping server. cleanup: joining server thread. server: closed connection cleanup: successfully joined. ok test_default_ciphers (__main__.ThreadedTests) ... ok test_echo (__main__.ThreadedTests) Basic test of an SSL client connecting to a server ... server: new connection from ('172.17.2.201', 19108) server: connection cipher is now ('AES256-SHA', 'TLSv1/SSLv3', 256) client: sending 'FOO\n'... server: read 'FOO\n' (encrypted), sending back 'foo\n' (encrypted)... client: read 'foo\n' client: sending bytearray(b'FOO\n')... server: read 'FOO\n' (encrypted), sending back 'foo\n' (encrypted)... client: read 'foo\n' client: sending ... server: read 'FOO\n' (encrypted), sending back 'foo\n' (encrypted)... client: read 'foo\n' client: closing connection. server: client closed connection ok test_empty_cert (__main__.ThreadedTests) Connecting with an empty cert file ... SSLError is _ssl.c:355: error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib ok test_getpeercert (__main__.ThreadedTests) ... {'notAfter': 'Oct 5 23:01:56 2020 GMT', 'subject': ((('countryName', u'XY'),), (('localityName', u'Castle Anthrax'),), (('organizationName', u'Python Software Foundation'),), (('commonName', u'localhost'),)), 'subjectAltName': (('DNS', 'localhost'),)} Connection cipher is ('AES256-GCM-SHA384', 'TLSv1/SSLv3', 256). ok test_handshake_timeout (__main__.ThreadedTests) ... ok test_malformed_cert (__main__.ThreadedTests) Connecting with a badly formatted certificate (syntax error) ... SSLError is _ssl.c:369: error:140DC009:SSL routines:SSL_CTX_use_certificate_chain_file:PEM lib ok test_malformed_key (__main__.ThreadedTests) Connecting with a badly formatted key (syntax error) ... SSLError is _ssl.c:355: error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib ok test_nonexisting_cert (__main__.ThreadedTests) Connecting with a non-existing cert file ... SSLError is _ssl.c:510: error:14094418:SSL routines:SSL3_READ_BYTES:tlsv1 alert unknown ca ok test_protocol_sslv2 (__main__.ThreadedTests) Connecting to an SSLv2 server with various client options ... skipped 'PROTOCOL_SSLv2 needed' test_protocol_sslv23 (__main__.ThreadedTests) Connecting to an SSLv23 server with various client options ... SSLv3->SSLv23 CERT_NONE ERROR test_protocol_sslv3 (__main__.ThreadedTests) Connecting to an SSLv3 server with various client options ... SSLv3->SSLv3 CERT_NONE SSLv3->SSLv3 CERT_OPTIONAL SSLv3->SSLv3 CERT_REQUIRED {TLSv1->SSLv3} CERT_NONE ok test_protocol_tlsv1 (__main__.ThreadedTests) Connecting to a TLSv1 server with various client options ... TLSv1->TLSv1 CERT_NONE TLSv1->TLSv1 CERT_OPTIONAL TLSv1->TLSv1 CERT_REQUIRED {SSLv3->TLSv1} CERT_NONE ok test_recv_send (__main__.ThreadedTests) Test recv(), send() and friends. ... server: new connection from ('172.17.2.201', 19138) server: connection cipher is now ('AES256-SHA', 'TLSv1/SSLv3', 256) ok test_rude_shutdown (__main__.ThreadedTests) A brutal shutdown of an SSL server should raise an IOError ... ok test_socketserver (__main__.ThreadedTests) Using a SocketServer to create and manage SSL connections. ... server (('172.17.2.201', 19141):19141 ('AES256-GCM-SHA384', 'TLSv1/SSLv3', 256)): [29/Nov/2014 22:21:52] "GET /keycert.pem HTTP/1.0" 200 - client: read 1783 bytes from remote server '>' ok test_starttls (__main__.ThreadedTests) Switching from clear text to encrypted and back again. ... server: new connection from ('172.17.2.201', 19144) client: sending 'msg 1'... server: read 'msg 1' (unencrypted), sending back 'msg 1' (unencrypted)... client: read 'msg 1' from server client: sending 'MSG 2'... server: read 'MSG 2' (unencrypted), sending back 'msg 2' (unencrypted)... client: read 'msg 2' from server client: sending 'STARTTLS'... server: read STARTTLS from client, sending OK... client: read 'OK\n' from server, starting TLS... client: sending 'MSG 3'... server: read 'MSG 3' (encrypted), sending back 'msg 3' (encrypted)... client: read 'msg 3' from server client: sending 'msg 4'... server: read 'msg 4' (encrypted), sending back 'msg 4' (encrypted)... client: read 'msg 4' from server client: sending 'ENDTLS'... server: read ENDTLS from client, sending OK... client: read 'OK\n' from server, ending TLS... server: connection is now unencrypted... client: sending 'msg 5'... server: read 'msg 5' (unencrypted), sending back 'msg 5' (unencrypted)... client: read 'msg 5' from server client: sending 'msg 6'... server: read 'msg 6' (unencrypted), sending back 'msg 6' (unencrypted)... client: read 'msg 6' from server client: closing connection. server: client closed connection ok test_wrapped_accept (__main__.ThreadedTests) Check the accept() method on SSL sockets. ... server: wrapped server socket as server: new connection from ('172.17.2.201', 19146) client: sending 'FOO\n'... client cert is {'notAfter': 'Oct 5 23:01:56 2020 GMT', 'subject': ((('countryName', u'XY'),), (('localityName', u'Castle Anthrax'),), (('organizationName', u'Python Software Foundation'),), (('commonName', u'localhost'),)), 'subjectAltName': (('DNS', 'localhost'),)} cert binary is 600 bytes server: connection cipher is now ('AES256-GCM-SHA384', 'TLSv1/SSLv3', 256) server: read 'FOO\n' (encrypted), sending back 'foo\n' (encrypted)... client: read 'foo\n' client: sending bytearray(b'FOO\n')... server: read 'FOO\n' (encrypted), sending back 'foo\n' (encrypted)... client: read 'foo\n' client: sending ... server: read 'FOO\n' (encrypted), sending back 'foo\n' (encrypted)... client: read 'foo\n' client: closing connection. server: client closed connection ok ====================================================================== ERROR: test_protocol_sslv23 (__main__.ThreadedTests) Connecting to an SSLv23 server with various client options ---------------------------------------------------------------------- Traceback (most recent call last): File "work/Python-2.7.8/Lib/test/test_ssl.py", line 1073, in test_protocol_sslv23 try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3, True) File "work/Python-2.7.8/Lib/test/test_ssl.py", line 937, in try_protocol_combo ciphers="ALL", chatty=False) File "work/Python-2.7.8/Lib/test/test_ssl.py", line 892, in server_params_test s.connect((HOST, server.port)) File "/usr/local/lib/python2.7/ssl.py", line 347, in connect self._real_connect(addr, False) File "/usr/local/lib/python2.7/ssl.py", line 337, in _real_connect self.do_handshake() File "/usr/local/lib/python2.7/ssl.py", line 319, in do_handshake self._sslobj.do_handshake() SSLError: [Errno 1] _ssl.c:510: error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure ====================================================================== FAIL: test_openssl_version (__main__.BasicSocketTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "work/Python-2.7.8/Lib/test/test_ssl.py", line 197, in test_openssl_version (s, t)) AssertionError: ('LibreSSL 2.1', (1, 0, 1, 7, 15)) ---------------------------------------------------------------------- Ran 38 tests in 1.383s FAILED (failures=1, errors=1, skipped=2) Traceback (most recent call last): File "work/Python-2.7.8/Lib/test/test_ssl.py", line 1442, in test_main() File "work/Python-2.7.8/Lib/test/test_ssl.py", line 1436, in test_main test_support.run_unittest(*tests) File "/usr/local/lib/python2.7/test/test_support.py", line 1338, in run_unittest _run_suite(suite) File "/usr/local/lib/python2.7/test/test_support.py", line 1321, in _run_suite raise TestFailed(err) test.test_support.TestFailed: multiple errors occurred