Skip to content

Commit

Permalink
Update server.py ssl wrapping
Browse files Browse the repository at this point in the history
The previous method for wrapping ssl was removed so update to the
replacement version.

Signed-off-by: William Douglas <[email protected]>
  • Loading branch information
bryteise committed Aug 28, 2024
1 parent 695417d commit 659f2c0
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions test/functional/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,16 +266,10 @@ def parse_arguments():

# configure ssl certificates
if args.server_cert and args.server_key:
wrap_socket_args = {"certfile": args.server_cert,
"keyfile": args.server_key,
"server_side": True}

# add client certificate
if args.client_cert:
wrap_socket_args.update({"ca_certs": args.client_cert,
"cert_reqs": ssl.CERT_REQUIRED})

httpd.socket = ssl.wrap_socket(httpd.socket, **wrap_socket_args)
wrap_socket_args = {"server_side": True}
context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
context.load_cert_chain(args.server_cert, args.server_key)
httpd.socket = context.wrap_socket(httpd.socket, **wrap_socket_args)

# invalid certificate combination
elif args.server_cert or args.server_key or args.client_cert:
Expand Down

0 comments on commit 659f2c0

Please sign in to comment.