-
Use mkcert
mkcert -install mkcert localhost # creates two localhost.pem (cert) and localhost-key.pem (key) file
-
provide the key and cert file to the http server program. For example in python if using uvicorn:
uvicorn.run("api.main:app", host="0.0.0.0", ssl_keyfile=key_path, ssl_certfile=cert_path, reload=True)