I trying to use Let’s Encrypt certs with internal test code written in python. I’ve got the certs (using the standard script on my web server) now I need to setup my python code. I’ve been using self-signed certs which work ok but are not trusted by the browser of course. I’m not sure how the four pem files map to the various named args of the ssl.wrap_socket() function or SSLSocket constructor. Here’s my old code:
server = BaseHTTPServer.HTTPServer(('127.0.0.1', 9999), Handler) server.socket = ssl.wrap_socket(server.socket, certfile='./server.pem', server_side=True) server.serve_forever()
The ssl.wrap_socket() has these named args:
certfile keyfile ca_certs
Which of these files map to the above arguments?
cert.pem chain.pem fullchain.pem privkey.pem
The python library docs were not much help.