Skip to content

Commit

Permalink
fix use of python ssl module
Browse files Browse the repository at this point in the history
  • Loading branch information
arvidn committed Nov 14, 2023
1 parent 5ce4c51 commit 7859695
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/web_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ def inner_do_GET(self):
http_handler.protocol_version = 'HTTP/1.1'
httpd = http_server_with_timeout(('127.0.0.1', port), http_handler)
if use_ssl:
httpd.socket = ssl.wrap_socket(httpd.socket, certfile='../ssl/server.pem', server_side=True)
ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
ctx.load_cert_chain("../ssl/server.pem")
httpd.socket = ctx.wrap_socket(httpd.socket, server_side=True)

while True:
httpd.handle_request()

0 comments on commit 7859695

Please sign in to comment.