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

What is the point of the 'secure' option #866

Open
Marc477 opened this issue Aug 20, 2015 · 5 comments
Open

What is the point of the 'secure' option #866

Marc477 opened this issue Aug 20, 2015 · 5 comments

Comments

@Marc477
Copy link

Marc477 commented Aug 20, 2015

What is the point of the 'secure' if the module only works (in https) when it is set to false ??

In an https.request, when we set rejectUnauthorized to true we also have to set the ca (certificate authority file), otherwise the certificate will fail validating. But there is no way to set https.request ca option in http-proxy.

@Marc477
Copy link
Author

Marc477 commented Aug 20, 2015

Fixed it by adding:

if(options.ca){
outgoing.ca = options.ca;
}

in common.js inside function common.setupOutgoing

Now it is working, but this should really be added to this project

@jcrugzz
Copy link
Contributor

jcrugzz commented Aug 20, 2015

@Marc477 pull-requests very much welcome

@Marc477
Copy link
Author

Marc477 commented Aug 20, 2015

I just found out that if a put all the certificate chain in my .crt file, I don't need to add it as ca parameter to https request ! But self-signed certificates are still a mystery for me since i always get the error: UNABLE_TO_VERIFY_LEAF_SIGNATURE, even after adding it to ca param

@Marc477
Copy link
Author

Marc477 commented Aug 20, 2015

Ok we need to add CA to server too, so we need to add CA option to http-proxy for self-signed certificates

@predhme
Copy link
Contributor

predhme commented Jul 28, 2016

I created a pull request here: #1042

Forgive me as I am unfamiliar with the projects setup, but this change I can assert fixes the problem that @Marc477 originally reported. I was encountering the same issue when using HTTPS to HTTPS with secure: true.

jcrugzz pushed a commit that referenced this issue Aug 11, 2016
While using secure: true for proxy connections, there is no way to pass the trusted root CA(s) or intermediate CA(s). This change allows that to be passed in the httpProxy createServer options and used for the outgoing proxy connection.
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

3 participants