Getting self signed certificate error with local cosmos db emulator
Closed this issue · 2 comments
arulselvam commented
Even if I set connectionPolicy.disableSSLVerification = true
, am getting self signed certificate error with local cosmos db emulator.
@azure/cosmos npm package version is 3.0.4
southpolesteve commented
@arulselvam Thanks for the bug report. I'll investigate this but as a workaround try putting this at the top of your entry point file: process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0;
southpolesteve commented
I'm going to remove this option as it doesn't currently work. There are now two ways to do this:
- Pass a custom agent
const client = new CosmosClient({
endpoint,
key,
agent: new https.Agent({
rejectUnauthorized: false
})
});
- Globally disable SSL Checks:
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
const client = new CosmosClient({
endpoint,
key
});