root@arduino:~# openssl genrsa -out python.key 2048
root@arduino:~# openssl req -new -key python.key -out python.csr
root@arduino:~# openssl x509 -req -days 365 -in python.csr -signkey python.key -out python.crt
root@arduino:~# cat python.crt python.key > python.pem
server = HTTPServer(('', PORT_NUMBER), myHandler)
server.socket = ssl.wrap_socket(server.socket,
keyfile='python.key',
certfile='python.pem',
ca_certs='python.crt',
server_side=True,
ssl_version=ssl.PROTOCOL_TLSv1)
server.serve_forever()
沒有留言:
張貼留言