Skip to content

Commit

Permalink
Move to recommended Python approach to wrapping socket to work with p…
Browse files Browse the repository at this point in the history
…ython 3.12
  • Loading branch information
AaronAtDuo committed Jun 20, 2024
1 parent 5ca4f5a commit 91513cd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/mockduo.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,9 @@ def main():

httpd = HTTPServerV6((host, port), MockDuoHandler)

httpd.socket = ssl.wrap_socket(httpd.socket, certfile=cafile, server_side=True)
ctx = ssl.SSLContext(protocol=ssl.PROTOCOL_TLS_SERVER)
ctx.load_cert_chain(cafile)
httpd.socket = ctx.wrap_socket(httpd.socket, server_side=True)

httpd.serve_forever()

Expand Down

0 comments on commit 91513cd

Please sign in to comment.