# taken from https://gist.github.com/DannyHinshaw/a3ac5991d66a2fe6d97a569c6cdac534
# which taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.pem with the following command:
# openssl req -new -x509 -keyout key.pem -out server.pem -days 365 -nodes
import http.server
import ssl
import sys
print("usage: <simple-https-server> <port> <cert pem file> <key pem file>")
port, certfile, keyfile = sys.argv[1:]
server_address = ('0.0.0.0', int(port))
httpd = http.server.HTTPServer(server_address, http.server.SimpleHTTPRequestHandler)
httpd.socket = ssl.wrap_socket(httpd.socket,
server_side=True,
certfile=certfile,
keyfile=keyfile,
ssl_version=ssl.PROTOCOL_TLS)
httpd.serve_forever()
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。