Skip to content

Instantly share code, notes, and snippets.

@dracos
Created September 24, 2015 13:54
Show Gist options
  • Select an option

  • Save dracos/085d86a5b2463aec8d44 to your computer and use it in GitHub Desktop.

Select an option

Save dracos/085d86a5b2463aec8d44 to your computer and use it in GitHub Desktop.
A minimal HTTPS server in python
from BaseHTTPServer import HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
import ssl
# Use a higher port if you don't want to have to run as root
httpd = HTTPServer(('', 443), SimpleHTTPRequestHandler)
httpd.socket = ssl.wrap_socket(httpd.socket, certfile='server.pem', server_side=True)
httpd.serve_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment