Basic tests for SSLSocket.version(). More tests are done in the test_protocol_*() methods.
(self)
| 3878 | self.assertIn("NO_SHARED_CIPHER", server.conn_errors[0]) |
| 3879 | |
| 3880 | def test_version_basic(self): |
| 3881 | """ |
| 3882 | Basic tests for SSLSocket.version(). |
| 3883 | More tests are done in the test_protocol_*() methods. |
| 3884 | """ |
| 3885 | context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) |
| 3886 | context.check_hostname = False |
| 3887 | context.verify_mode = ssl.CERT_NONE |
| 3888 | with ThreadedEchoServer(CERTFILE, |
| 3889 | ssl_version=ssl.PROTOCOL_TLS_SERVER, |
| 3890 | chatty=False) as server: |
| 3891 | with context.wrap_socket(socket.socket()) as s: |
| 3892 | self.assertIs(s.version(), None) |
| 3893 | self.assertIs(s._sslobj, None) |
| 3894 | s.connect((HOST, server.port)) |
| 3895 | self.assertEqual(s.version(), 'TLSv1.3') |
| 3896 | self.assertIs(s._sslobj, None) |
| 3897 | self.assertIs(s.version(), None) |
| 3898 | |
| 3899 | @requires_tls_version('TLSv1_3') |
| 3900 | def test_tls1_3(self): |
nothing calls this directly
no test coverage detected