diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2014-04-17 10:21:36 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2014-04-17 10:21:36 (GMT) |
commit | 05649f39ecee943a50670a28ef4e9758c98add98 (patch) | |
tree | 4365258ef0bd0bcd5d230f76cf66ed258fe7cf1e /Lib/test/ssl_servers.py | |
parent | 8bdeb1672ce1d0412e1fcc6cff0821bb66f02c1a (diff) | |
download | cpython-05649f39ecee943a50670a28ef4e9758c98add98.zip cpython-05649f39ecee943a50670a28ef4e9758c98add98.tar.gz cpython-05649f39ecee943a50670a28ef4e9758c98add98.tar.bz2 |
Use ssl.create_default_context in Lib/test/ssl_servers.py
Diffstat (limited to 'Lib/test/ssl_servers.py')
-rw-r--r-- | Lib/test/ssl_servers.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/ssl_servers.py b/Lib/test/ssl_servers.py index 759b3f4..e6ae7c4 100644 --- a/Lib/test/ssl_servers.py +++ b/Lib/test/ssl_servers.py @@ -150,7 +150,7 @@ class HTTPSServerThread(threading.Thread): def make_https_server(case, *, context=None, certfile=CERTFILE, host=HOST, handler_class=None): if context is None: - context = ssl.SSLContext(ssl.PROTOCOL_SSLv23) + context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH) # We assume the certfile contains both private key and certificate context.load_cert_chain(certfile) server = HTTPSServerThread(context, host, handler_class) @@ -192,7 +192,7 @@ if __name__ == "__main__": else: handler_class = RootedHTTPRequestHandler handler_class.root = os.getcwd() - context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) + context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH) context.load_cert_chain(CERTFILE) if args.curve_name: context.set_ecdh_curve(args.curve_name) |