Created
August 18, 2017 18:46
-
-
Save leslie-wang/3dae68e3999e656902dd3c6a7b461118 to your computer and use it in GitHub Desktop.
SimpleHTTPSServer to serve HTTPS request
This file contains hidden or 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
| import BaseHTTPServer, SimpleHTTPServer | |
| import ssl | |
| httpd = BaseHTTPServer.HTTPServer(('localhost', 4443), | |
| SimpleHTTPServer.SimpleHTTPRequestHandler) | |
| httpd.socket = ssl.wrap_socket (httpd.socket, | |
| keyfile="server.key", | |
| certfile='server.crt', server_side=True) | |
| httpd.serve_forever() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment