def setUp(self): self._cert_file, self._cert_key = create_temp_self_signed_cert() ssl_context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH) ssl_context.load_cert_chain(self._cert_file, self._cert_key) self._init_server(self.loop, ssl_context=ssl_context)
def setUp(self): self._cert_file, self._cert_key = create_temp_self_signed_cert() ssl_context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH) ssl_context.load_cert_chain(self._cert_file, self._cert_key) self._init_server(self.loop, ssl_context=ssl_context)
def test_create_temp_self_signed_cert_can_generate_more_than_one_pair_of_keys(self): (second_cert, second_key) = create_temp_self_signed_cert() # Check the second certificate is different and exists self.assertNotEqual(self.cert, second_cert) self.assertTrue(os.path.isfile(second_cert)) # Check the second key is different and exists self.assertNotEqual(self.key, second_key) self.assertTrue(os.path.isfile(second_key)) # Clean up os.remove(second_cert) os.remove(second_key)
def test_create_temp_self_signed_cert_can_generate_more_than_one_pair_of_keys( self): (second_cert, second_key) = create_temp_self_signed_cert() # Check the second certificate is different and exists self.assertNotEqual(self.cert, second_cert) self.assertTrue(os.path.isfile(second_cert)) # Check the second key is different and exists self.assertNotEqual(self.key, second_key) self.assertTrue(os.path.isfile(second_key)) # Clean up os.remove(second_cert) os.remove(second_key)
def setUp(self): self.cert, self.key = create_temp_self_signed_cert()
def setUp(self): self.cert, self.key = create_temp_self_signed_cert()