Created
December 31, 2017 12:56
-
-
Save samduy/66079fbea4f2df74ecd95940d81e878a to your computer and use it in GitHub Desktop.
SSL Encrypted SimpleHTTPServer
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
# Create SSL cert (follow prompts for customization) | |
# > openssl req -new -x509 -keyout cert.pem -out cert.pem -days 365 -nodes | |
# Create httpserver.py | |
import BaseHTTPServer,SimpleHTTPServer,ssl | |
cert = "cert.pem" | |
httpd = BaseHTTPServer.HTTPServer(('192.168.1.10',443),SimpleHTTPServer.SimpleHTTPRequestHandler) | |
httpd.socket = ssl.wrap_socket(httpd.socket,certfile=cert,server_side=True) | |
httpd.serve_forever() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment