Sometime, you need to run your local development work as a trusted site. mkcert will help to make your life easier.

Install (use Chocolatey): choco install mkcert

or download from this link https://github.com/FiloSottile/mkcert/releases

Commands:

  • mkcert -install
    Install the local CA in the system trust store
  • mkcert example.com myapp.dev localhost 127.0.0.1 ::1
    Generate “example.com+4.pem” and “example.com+4-key.pem”

Example usage:

With the key files generated, you can use it in nginx config as below:

        listen       443 ssl;
        server_name  example.com;

        ssl_certificate      c:/<path>/example.com+4.pem;
        ssl_certificate_key  c:/<path>/example.com+4-key.pem;

        ssl_session_cache    shared:SSL:1m;
        ssl_session_timeout  5m;

        ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers  on;