Skip to content

Instantly share code, notes, and snippets.

@0xBADCA7
Created May 21, 2015 19:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save 0xBADCA7/41f3ece467204b799b79 to your computer and use it in GitHub Desktop.
Save 0xBADCA7/41f3ece467204b799b79 to your computer and use it in GitHub Desktop.
Simple HTTPS server in Python 3
#!/usr/bin/env python3
from http.server import HTTPServer,SimpleHTTPRequestHandler
from socketserver import BaseServer
import ssl
httpd = HTTPServer(('localhost', 1443), SimpleHTTPRequestHandler)
httpd.socket = ssl.wrap_socket (httpd.socket, certfile='certificate.pem', keyfile='privatekey.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