Answers for "ssl server python"

0

ssl server python

1. openssl req -new -x509 -days 365 -nodes -out cert.pem -keyout cert.pem
2. Use the Code

import BaseHTTPServer, SimpleHTTPServer
import ssl

httpd = BaseHTTPServer.HTTPServer(('localhost', 4443), SimpleHTTPServer.SimpleHTTPRequestHandler)
httpd.socket = ssl.wrap_socket (httpd.socket, certfile='./server.pem', server_side=True) # Generate the CRT File by OPENSSL.
httpd.serve_forever()
Posted by: Guest on July-02-2021

Python Answers by Framework

Browse Popular Code Answers by Language