import http.server, ssl, os
os.chdir("/tmp")
ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
ctx.minimum_version = ssl.TLSVersion.TLSv1
ctx.maximum_version = ssl.TLSVersion.TLSv1_2
ctx.set_ciphers("DEFAULT:!aNULL:!eNULL:@SECLEVEL=0")
ctx.load_cert_chain("/tmp/cert.pem","/tmp/key.pem")
srv = http.server.HTTPServer(("0.0.0.0",8443), http.server.SimpleHTTPRequestHandler)
srv.socket = ctx.wrap_socket(srv.socket, server_side=True)
srv.serve_forever()
