Simple HTTPS server in python
Starting a HTTP server in python to serve files from a directory is a reasonably well-known one-liner. In python 2.x it is: python -m SimpleHTTPServer 8080 In python 3.x it is: python -m http.server 8080 But how do you something similar for HTTPS? Here’s a solution, which unfortunately is larger than one line: #!/usr/bin/python import BaseHTTPServer, SimpleHTTPServer import ssl httpd = BaseHTTPServer.HTTPServer(('0.0.0.0', 8443), SimpleHTTPServer.SimpleHTTPRequestHandler) httpd.socket = ssl.wrap_socket(httpd.socket, certfile='./certs_and_key.pem', server_side=True) httpd.serve_forever() Save that as an executable file, combine your PEM cert chain and key into a single file, and off you go!...