Skip to main content

Enabling SSL/TLS

Enabling SSL/TLS as your security layer for HTTPS.

  1. Install OpenSSL
  2. Change your working directory to the project root.
cd minhttp
  1. Generate a private key.
openssl genpkey -algorithm RSA -out key.pem -aes256
  1. Generate a self-signed certificate.
openssl req -new -x509 -key key.pem -out cert.pem -days 365
  1. Configure your server to use SSL/TLS by setting the ssl_enabled parameter to True in the MinHTTPServer constructor.
app = minhttpserver.MinHTTPServer(host, port, ssl_enabled=True)