Skip to content

Commit

Permalink
Switch away from deprecated ssl API (#18472)
Browse files Browse the repository at this point in the history
  • Loading branch information
iliakur authored Aug 30, 2024
1 parent f4062f5 commit 9693964
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spark/tests/test_spark.py
Original file line number Diff line number Diff line change
Expand Up @@ -1306,9 +1306,11 @@ def do_GET(self):

def run_ssl_server():
cert_file = os.path.join(CERTIFICATE_DIR, 'server.pem')
context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
context.load_cert_chain(cert_file)

httpd = BaseHTTPServer.HTTPServer((SSL_SERVER_ADDRESS, SSL_SERVER_PORT), StandaloneAppsResponseHandler)
httpd.socket = ssl.wrap_socket(httpd.socket, certfile=cert_file, server_side=False)
httpd.socket = context.wrap_socket(httpd.socket, server_side=False)
httpd.timeout = 5

threading.Thread(target=httpd.handle_request).start()
Expand Down

0 comments on commit 9693964

Please sign in to comment.