Skip to content

Instantly share code, notes, and snippets.

@unnamalai-kb
Created January 31, 2019 04:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save unnamalai-kb/6e87b9a1f9557cc24b2842fcf707e7cc to your computer and use it in GitHub Desktop.
Save unnamalai-kb/6e87b9a1f9557cc24b2842fcf707e7cc to your computer and use it in GitHub Desktop.
Python 3 Simple HTTPS Server
# python ../httpsserver.py
# in your browser, visit:
# https://localhost:4443
from http.server import HTTPServer, SimpleHTTPRequestHandler
import ssl
httpd = HTTPServer(("localhost", 4443), SimpleHTTPRequestHandler)
httpd.socket = ssl.wrap_socket (httpd.socket, certfile="../httpsserver.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