Skip to content

mkcert 本地测试 https

https://github.com/FiloSottile/mkcert

在需要连接 https 服务的机器或者容器上执行

bash
mkcert -install
mkcert example.com "*.example.com" example.test localhost 127.0.0.1 ::1

拷贝证书到 https 服务所在目录

比如使用 uvicorn

bash
python3 -m uvicorn main:app --host 0.0.0.0 --ssl-keyfile xxx-key.pem --ssl-certfile xxx.pem

最后更新于: