-
Notifications
You must be signed in to change notification settings - Fork 762
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
How to disable strictSSL check? #1121
Comments
What version of |
The latest. 3.0.20. |
I am also experiencing the same issue. I am using a self-signed cert, and I need to disable the ssl verification |
Hi folks! First, please note that Secondly, it's always better to set up your system to trust your self-signed certificates rather than disable TLS validation. However, if you really want to do so, here's how you'd do it: const Swagger = require("swagger-client")
process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = "0"
// not actually a Swagger document, but simulates a self-signed cert
Swagger({ url: "https://untrusted-root.badssl.com" })
.then(client => console.log(client))
.catch(console.error) Please note that this will completely neuter SSL for all requests that your project makes. We do offer a way to bring your own Fetch implementation if you're using the I'll close with a quote from the Superagent issue tracker, which had a similar discussion last year:
I recommend that you look into adding your certificates to your operating system's trust store 😄 |
In my case, I'm working behind a corporate firewall. IT doesn't release the self-signed certs, so I am not able to access them. I was looking for a way to disable TLS checking for just my single request, not for my entire Node process. I've seen superagent's stance on it, and also a part of the reason why I cannot utilize superagent in a node environment. I will look into the buildRequest/execute API. Thanks. |
Solution With AgentThere is a very simple solution: Yes, @shockey, you cannot set
|
@mwaeckerlin thanks, I think this is worth adding into our documentation. Created an related issue. |
I'm attempting to disable checking of self-signed certs to avoid the
UNABLE_TO_VERIFY_LEAF_SIGNATURE
error. Typically, withrequest
, I would simply pass itrejectUnauthorized: false
orstrictSSL: false
.I've tried this, but it does not seem to work:
The error:
Any insight on how to accomplish this?
The text was updated successfully, but these errors were encountered: