diff options
author | Scott Talbert <swt@techie.net> | 2022-12-01 19:22:33 -0500 |
---|---|---|
committer | Scott Talbert <swt@techie.net> | 2022-12-01 19:22:33 -0500 |
commit | 32af40323f9d0a7ab3c561507b5e614010bb2a08 (patch) | |
tree | 842aed0169fc115fbfc4f029bb999c802e22f6d9 /tests/runwsgi.py | |
parent | d753cb7d482387dac2369aed9fdf3f428e7382b1 (diff) | |
download | pycurl-32af40323f9d0a7ab3c561507b5e614010bb2a08.tar.gz |
Replace use of deprecated ssl.wrap_context in tests/runwsgi.py
Diffstat (limited to 'tests/runwsgi.py')
-rw-r--r-- | tests/runwsgi.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/runwsgi.py b/tests/runwsgi.py index 1f622bc..ff00b8c 100644 --- a/tests/runwsgi.py +++ b/tests/runwsgi.py @@ -35,10 +35,12 @@ class SslServer(Server): import ssl cert_dir = os.path.join(os.path.dirname(__file__), 'certs') - self.srv.socket = ssl.wrap_socket( + context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) + context.load_cert_chain( + os.path.join(cert_dir, 'server.crt'), + keyfile=os.path.join(cert_dir, 'server.key')) + self.srv.socket = context.wrap_socket( self.srv.socket, - keyfile=os.path.join(cert_dir, 'server.key'), - certfile=os.path.join(cert_dir, 'server.crt'), server_side=True) self.serve() |