-
-
Save h007/196575c0d68d3832d246f1a32c07e6fd to your computer and use it in GitHub Desktop.
Simple HTTPS server in Python 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from http.server import HTTPServer,SimpleHTTPRequestHandler | |
from socketserver import BaseServer | |
import ssl | |
httpd = HTTPServer(('0.0.0.0', 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
to create the cert without installing anything: