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

HTTP.get generates a SELF_SIGNED_CERT_IN_CHAIN error #2866

Closed
bluemonk opened this issue Oct 20, 2014 · 8 comments
Closed

HTTP.get generates a SELF_SIGNED_CERT_IN_CHAIN error #2866

bluemonk opened this issue Oct 20, 2014 · 8 comments

Comments

@bluemonk
Copy link

Hello,

the following code

if (Meteor.isServer) {
  Meteor.startup(function () {
    var result = HTTP.get("https://server/url",
              {headers: {"Accept": "application/vnd.com.cisco.ise.identity.endpoint.1.0+xml"}, 
               auth: "user:pass"});
  });
}

generates the following error

Error: SELF_SIGNED_CERT_IN_CHAIN

is it a known issue with Self Signed certificates? Am I doing something wrong with the options?

@glasser
Copy link
Contributor

glasser commented Oct 21, 2014

Sounds like you have a self-signed certificate in your chain? By default a good HTTPS library ought to be wary of such things and only trust certificates with a known root.

If you need more subtle control over your https requests, I recommend using the request npm module.

@glasser glasser closed this as completed Oct 21, 2014
@bluemonk
Copy link
Author

I understand and appreciate it. Thanks for taking the time to answer.

It is very common for companies and enterprises to have their certificates issued by an internal CA, since they do not plan to expose their services to the internet. Moreover, a self-signed certificate could be handy when starting up a new project.

Do you think it would be a good idea to maybe have an option to explicitly accept self-signed certificates, disabled by default like it is today?

@bluemonk
Copy link
Author

For future reference, adding

process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';

at the beginning of the file proved to be an effective workaround. Not ideal, but it's working.

@tagrudev
Copy link

I have absolutely the same problem - points are valid @bluemonk (Moreover, a self-signed certificate could be handy when starting up a new project).

@bluemonk did you manage to find a workaround ?

@bluemonk
Copy link
Author

Yes I've posted it just above.

@tagrudev
Copy link

You've added that to the specific route ?

@dandv
Copy link
Contributor

dandv commented Dec 17, 2014

@bluemonk - maybe this request will help convince MDG to pass-through unknown HTTP options to the underlying module.

@deligence
Copy link

@bluemonk - It helps and resolve my issue as well, Thanks

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