Skip to content

Develop using HTTPS

To develop locally with HTTPS using a trusted certificate, it is recommended to use mkcert, which is a simple tool for making locally-trusted development certificates.

  • Install mkcert
  • Install the root certificates authority (CA) using the mkcert --install command
  • Generate a certificate for local development using the command: mkcert localhost 127.0.0.1 ::1
  • Use the feature of the ASGI server you select, to run with HTTPS. For uvicorn, refer to this documentation: https://www.uvicorn.org/deployment/#running-with-https.

Example:

mkcert --install

mkcert localhost 127.0.0.1 ::1

uvicorn server:app --port 44555 --ssl-keyfile=./localhost-key.pem --ssl-certfile=./localhost.pem

Local HTTPS

Last modified on: 2023-07-16 08:51:27