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

Use rejectUnauthorized instead of strictSSL #390

Closed
wants to merge 1 commit into from

Conversation

Megapixel99
Copy link
Contributor

When running the module with strictSSL set to false (because I set insecureSkipTlsVerify to true and strictSSL is the opposite of insecureSkipTlsVerify) I receive the following error for a self signed certificate:

/Volumes/Work/stat-tracker/node_modules/openshift-rest-client/lib/basic-auth-request.js:7
  const err = new Error(requestError.message);
              ^

Error: self-signed certificate in certificate chain
    at buildError (/Volumes/Work/stat-tracker/node_modules/openshift-rest-client/lib/basic-auth-request.js:7:15)
    at /Volumes/Work/stat-tracker/node_modules/openshift-rest-client/lib/basic-auth-request.js:33:21
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  statusCode: 'SELF_SIGNED_CERT_IN_CHAIN'
}

Upon further investigation I found this answer https://stackoverflow.com/a/76227420 which states you can use rejectUnauthorized to ignore invalid (self signed) certificates.

Looking online, specifically at: https://stackoverflow.com/questions/49320486/nodejs-ssl-options-strictssl-vs-rejectunauthorized, I see that strictSSL and rejectUnauthorized are supposed to be equivalent, so I am unsure if there is an issue with undici, but changing strictSSL to rejectUnauthorized seem to fix the issue for me.

Even though they should be the same thing, `strictSSL` was not working but `rejectUnauthorized` does.
@lholmquist
Copy link
Member

There is also another occurence here: https://github.com/nodeshift/openshift-rest-client/blob/main/lib/authorization-server-request.js#L21. might want to update all the locations

@lholmquist
Copy link
Member

closed via #401 Thanks for the contribution

@lholmquist lholmquist closed this Apr 23, 2024
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

Successfully merging this pull request may close these issues.

2 participants