summaryrefslogtreecommitdiffstats
path: root/Lib/test/ssl_servers.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/ssl_servers.py')
-rw-r--r--Lib/test/ssl_servers.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/Lib/test/ssl_servers.py b/Lib/test/ssl_servers.py
index f4a0bed..759b3f4 100644
--- a/Lib/test/ssl_servers.py
+++ b/Lib/test/ssl_servers.py
@@ -147,9 +147,11 @@ class HTTPSServerThread(threading.Thread):
self.server.shutdown()
-def make_https_server(case, certfile=CERTFILE, host=HOST, handler_class=None):
- # we assume the certfile contains both private key and certificate
- context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+def make_https_server(case, *, context=None, certfile=CERTFILE,
+ host=HOST, handler_class=None):
+ if context is None:
+ context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+ # We assume the certfile contains both private key and certificate
context.load_cert_chain(certfile)
server = HTTPSServerThread(context, host, handler_class)
flag = threading.Event()