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

self signed certificate error when calling https end point #181

Open
gurupraveen-avvaru opened this issue Feb 23, 2018 · 6 comments
Open

Comments

@gurupraveen-avvaru
Copy link

Hi Team,

I am calling https end point using node-rest-client, I am getting below error.

events.js:137
throw er; // Unhandled 'error' event
^

Error: self signed certificate in certificate chain
at TLSSocket.onConnectSecure (_tls_wrap.js:1041:34)
at TLSSocket.emit (events.js:160:13)
at TLSSocket._finishInit (_tls_wrap.js:638:8)

Please let me know how to fix this issue.

--Guru

@ranupoju0126
Copy link

I am also having the same issue, there is temporary solution to add rejectUnauthorized as false, which is not safe,

I did find the options in documentation, but still same error occurs
image

@pranavtheway
Copy link

where exactly this configuration needs to be edited?

@ranupoju0126
Copy link

@gurupraveen-avvaru
Hope you have that self signed certificate .crt file
convert that .crt file to .pem file using the following command
openssl x509 -inform DER -outform PEM -in server.crt -out server.pem

then use give the path of that .pem file in options
var options = {
user:xxxxxx
password: xxxxxx,
connection: {
ca:fs.readFileSync('/Users/xxxx/WebstormProjects/project-Master/server/server.pem')
},
}

Done! This will work for sure

@pranavtheway
Copy link

Hey @ranupoju0126

Where can i get the .crt file and what configuration file we are talking about here?

@teja12687
Copy link

@pranavtheway
.crt file you should get from the team who has done secure connections to the domain(https).

I am not sure about what configuration file you are talking about

Th only configuration I know is which I posted a screenshot in my previous comment.

@drizzyemtk54
Copy link

i got this error using nodemailer and gmail as my demo account.. any solutions?

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