Create the locally trusted development certificates
開源專案 mkcert,建立本機信任憑證供開發時使用。
透過 brew 安裝 mkcert 命令。
1brew install mkcert
2brew install nss # if you use Firefox
建立 local CA。
Warning: the
rootCA-key.pem
file that mkcert automatically generates gives complete power to intercept secure requests from your machine. Do not share it.
1mkcert -install
2Created a new local CA 💥
3The local CA is now installed in the system trust store! ⚡️
4The local CA is now installed in the Firefox trust store (requires browser restart)! 🦊
建立憑證範例。
1mkcert example.com "*.example.com" example.test localhost 127.0.0.1 ::1