Created
August 3, 2017 03:48
-
-
Save movii/3253a561c6dc940188d71a0db895e031 to your computer and use it in GitHub Desktop.
笔记:OpenSSL 生成「自签名」证书,配置 Nodejs 本地 HTTPS 服务 - 17. Python3 跑 HTTPS server
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
# Python3 跑 HTTPS server | |
from http.server import HTTPServer, SimpleHTTPRequestHandler | |
import ssl | |
httpd = HTTPServer(('localhost', 4443), SimpleHTTPRequestHandler) | |
httpd.socket = ssl.wrap_socket (httpd.socket, | |
keyfile="ssl.key", | |
certfile='ssl.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