1

My local development workstation is behind company's firewall. It uses a self-sign CA which is not trusted. So when I try to access the Azure key vaults using DefaultAzureCredential from @azure/identity, I get the error

FetchError: request to https://mytestkv.azure.net/secrets/mypassword/?api-version=7.2 failed, reason: unable to verify the first certificate

I know it is a certificate issue because if I deploy my application to Azure, there is no problem to access the key vault for the application. My application is a Javascript/Node application.

Is there a way to let the application not check self-signed certificate?

user3616544
  • 1,023
  • 1
  • 9
  • 31
  • In local dev environment, your code should read settings.json (or environment variables) rather than from Az keyvault. – Anand Sowmithiran Nov 12 '21 at 11:30
  • Check this thread if it helps : https://stackoverflow.com/questions/31673587/error-unable-to-verify-the-first-certificate-in-nodejs. Setting strictSSL: false might solve the issue – RamaraoAdapa Nov 12 '21 at 11:39

1 Answers1

0

As you are using a self-signed certificate, setting strictSSL to false will not force Key Vault to validate the certificate.

strictSSL: false
RamaraoAdapa
  • 2,837
  • 2
  • 5
  • 11