def create_certs(dir): return cacert, cakey = create_self_signed_cacert() write_cert(cacert, dir, 'ca-cert.pem') # write_key(cakey, dir, 'ca-key.pem') cert, key = create_session_cert(cacert, cakey) write_cert(cert, dir, 'client-cert.pem') write_key(key, dir, 'client-key.pem') cert, key = create_session_cert(cacert, cakey) write_cert(cert, dir, 'server-cert.pem') write_key(key, dir, 'server-key.pem')
def test_server(self): cacert, cakey = create_self_signed_cacert() cert, key = create_session_cert(cacert, cakey) server = SecureHTTPServer(("localhost", 4443), key, cert, SecureHTTPRequestHandler) Thread(target=server.serve_forever()).run()