Subash / mkcert

Create self signed ssl certificates without OpenSSL.
MIT License
138 stars 12 forks source link

Help achieving parity with golang mkcert CLI #2

Closed sslotsky closed 4 years ago

sslotsky commented 4 years ago

Hi there! We are currently using the golang mkcert package to create a certificate, and we're in the process of migrating over to the npm version. I'm having difficulty achieving parity between the two.

Our script to install using the golang package looks like this:

# get and install mkcerts
go get github.com/FiloSottile/mkcert
# install ca into trusted store
go run github.com/FiloSottile/mkcert -install
# generate certificates
mkdir certs
go run github.com/FiloSottile/mkcert \
-cert-file=certs/arigato.tools+2.pem \
-key-file=certs/arigato.tools+2-key.pem \
arigato.tools localhost 127.0.0.1

The npm version:

npx mkcert create-ca
npx mkcert create-cert \
 --key certs/arigato.tools+2-key.pem \
 --cert certs/arigato.tools+2.pem \
 --domains "localhost,127.0.0.1,arigato.tools"

The npm version runs without failure and I see my key & cert files in the correct location. But when I start my web server, I get NET::ERR_CERT_AUTHORITY_INVALID. I think this is because when I create the CA, it just adds ca.key and ca.crt to the project root, rather than installing it in the system trust store. But the package documentation doesn't seem to indicate how to get it there.

Does this package have a way to install the CA in the system trust store?

Thanks!

Subash commented 4 years ago

I am sorry for the confusion. This package is not related to the golang version. The name is just a coincidence. I will put up a notice about that in the readme. Also, this package doesn’t support adding CA to the system trust store.