Basic tests for SSLSocket.version(). More tests are done in the test_protocol_*() methods.
(self)
| 4163 | self.assertIsNone(s.group()) |
| 4164 | |
| 4165 | def test_version_basic(self): |
| 4166 | """ |
| 4167 | Basic tests for SSLSocket.version(). |
| 4168 | More tests are done in the test_protocol_*() methods. |
| 4169 | """ |
| 4170 | context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) |
| 4171 | context.check_hostname = False |
| 4172 | context.verify_mode = ssl.CERT_NONE |
| 4173 | with ThreadedEchoServer(CERTFILE, |
| 4174 | ssl_version=ssl.PROTOCOL_TLS_SERVER, |
| 4175 | chatty=False) as server: |
| 4176 | with context.wrap_socket(socket.socket()) as s: |
| 4177 | self.assertIs(s.version(), None) |
| 4178 | self.assertIs(s._sslobj, None) |
| 4179 | s.connect((HOST, server.port)) |
| 4180 | self.assertEqual(s.version(), 'TLSv1.3') |
| 4181 | self.assertIs(s._sslobj, None) |
| 4182 | self.assertIs(s.version(), None) |
| 4183 | |
| 4184 | @requires_tls_version('TLSv1_3') |
| 4185 | def test_tls1_3(self): |
nothing calls this directly
no test coverage detected