ssl server python

Solutions on MaxInterview for ssl server python by the best coders in the world

showing results for - "ssl server python"
Krystal
06 Mar 2020
11. openssl req -new -x509 -days 365 -nodes -out cert.pem -keyout cert.pem
22. Use the Code
3
4import BaseHTTPServer, SimpleHTTPServer
5import ssl
6
7httpd = BaseHTTPServer.HTTPServer(('localhost', 4443), SimpleHTTPServer.SimpleHTTPRequestHandler)
8httpd.socket = ssl.wrap_socket (httpd.socket, certfile='./server.pem', server_side=True) # Generate the CRT File by OPENSSL.
9httpd.serve_forever()