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

How to set self signed certificate in Nodejs process #3501

Closed
nomanmaqsood opened this issue Aug 13, 2021 · 1 comment
Closed

How to set self signed certificate in Nodejs process #3501

nomanmaqsood opened this issue Aug 13, 2021 · 1 comment

Comments

@nomanmaqsood
Copy link

nomanmaqsood commented Aug 13, 2021

Hello

I need a little help to set a self signed certificate in Nodejs. I have been doing research on this for many days and found a working solution in one of the GitHub issues of nodejs

This is how I am setting global options

    const CA_STORE = await getCertificate()
    https.globalAgent.options.ca = [];

    https.globalAgent.options.ca.push(CA_STORE)

The solution really set the self signed certificate into node.js process but the problem is it overrides the default trusted certificates of Nodejs and my other Axios call that are using public certificates stop working.

I cannot use NODE_EXTRA_CA_CERTS because I cannot set its value runtime (I am reading the certificate from s3)

@Ayase-252
Copy link
Member

Closing as duplicate of #3502.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants