Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Certificates are rejected by Node #78

Closed
dpraul opened this issue Oct 10, 2018 · 5 comments
Closed

Certificates are rejected by Node #78

dpraul opened this issue Oct 10, 2018 · 5 comments

Comments

@dpraul
Copy link

dpraul commented Oct 10, 2018

Node uses its own list of accepted CAs, not the system store, thus certificates generated by mkcert are rejected by Node requests.

That said, as of Node v7.3.0, Node implements a NODE_EXTRA_CA_CERTS environment variable that can be used to specify extra rootCAs to trust. So it sounds like this could be remedied by setting this environment variable to the rootCA path during -install.

@adamdecaf
Copy link
Contributor

That's what I have done in the past. How were you suggesting mkcert set environment variables? That seems out of scope for mkcert and better done by all the local dev / deployment tools.

@dpraul
Copy link
Author

dpraul commented Oct 10, 2018

I figured since the Java trust store was supported it would fall in-scope, but totally understood if that's not the case (if so, maybe a note can be added to the README just so others don't experience the issue).

And in regards to how, I assumed that a global environment variable could be set since mkcert already makes changes that require elevated permissions. Maybe a guard would be added wherein the env var would not be overwritten if it already exists.

@FiloSottile
Copy link
Owner

Setting global env vars permanently is not easy to do universally and probably unexpected. What we can do though is document how to use mkcert -CAROOT to set NODE_EXTRA_CA_CERTS in the README.

@rfay
Copy link

rfay commented Oct 3, 2019

Here's a solution for node, at least it worked for me:

export NODE_EXTRA_CA_CERTS="$(mkcert -CAROOT)/rootCA.pem"

@waldyrious
Copy link

waldyrious commented Oct 5, 2019

@rfay that is exactly what @FiloSottile added to the README (as seen here) in the PR that fixed this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants