Skip to content

Instantly share code, notes, and snippets.

@blangenfeld
Created April 12, 2016 19:56
Show Gist options
  • Save blangenfeld/a5b5a768da4828f876b948cff1b08044 to your computer and use it in GitHub Desktop.
Save blangenfeld/a5b5a768da4828f876b948cff1b08044 to your computer and use it in GitHub Desktop.
Four line HTTPS server
import BaseHTTPServer, SimpleHTTPServer, ssl
httpd = BaseHTTPServer.HTTPServer(('localhost', 4443), SimpleHTTPServer.SimpleHTTPRequestHandler)
httpd.socket = ssl.wrap_socket (httpd.socket, certfile='./localhost.pem', keyfile='./localhost.key', server_side=True)
httpd.serve_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment