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

DEPTH_ZERO_SELF_SIGNED_CERT error #22

Closed
catamphetamine opened this issue Jun 22, 2015 · 2 comments
Closed

DEPTH_ZERO_SELF_SIGNED_CERT error #22

catamphetamine opened this issue Jun 22, 2015 · 2 comments

Comments

@catamphetamine
Copy link

Can be avoided by:

process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0" # Avoids DEPTH_ZERO_SELF_SIGNED_CERT error for self-signed certs

But maybe there is a better option.
I didn't find the option in your readme.

There is an option called rejectUnauthorized.
https://nodejs.org/api/tls.html

Seems that it's the option to look into:

var req = (ssl ? https : http).request({ rejectUnauthorized������������������������������������������������������: false })

You'll have to make an opiton for this one

@yyscamper
Copy link

@halt-hammerzeit:
I encountered same issue, I fixed it by adding the rejectUnauthorized option in decorateRequest:

app.use('/proxy', proxy('www.google.com', {
  forwardPath: function(req, res) {
    return require('url').parse(req.url).path;
  },
  decorateRequest: function(req) {
       req.rejectUnauthorized=false;
       return req;
  }
}));

@catamphetamine
Copy link
Author

Also recently I found out about Node.js TLS module ca option which takes your self-generated root CA and then this error goes away.

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

2 participants