Files
codeql/java/ql/integration-tests/java/buildless-inherit-trust-store/server.py
Chris Smowton 5892cdf456 Avoid CodeQL alert against integration test
This doesn't really matter since it's a dummy test server, but it's simpler to fix than to dismiss.
2025-03-20 15:49:21 +00:00

14 lines
404 B
Python

from http.server import HTTPServer, SimpleHTTPRequestHandler
import ssl
httpd = HTTPServer(('localhost', 4443), SimpleHTTPRequestHandler)
sslctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
sslctx.options |= ssl.OP_NO_TLSv1 | ssl.OP_NO_TLSv1_1
sslctx.load_cert_chain(certfile="../cert.pem", keyfile="../key.pem")
httpd.socket = sslctx.wrap_socket (httpd.socket, server_side=True)
httpd.serve_forever()