Skip to content

Instantly share code, notes, and snippets.

@movii
Created August 3, 2017 03:48
Show Gist options
  • Save movii/3253a561c6dc940188d71a0db895e031 to your computer and use it in GitHub Desktop.
Save movii/3253a561c6dc940188d71a0db895e031 to your computer and use it in GitHub Desktop.
笔记:OpenSSL 生成「自签名」证书,配置 Nodejs 本地 HTTPS 服务 - 17. Python3 跑 HTTPS server
# 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