SOLVED: Using the Azure Command-Line Interface (CLI) behind Fiddler - [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate

If you want to use Fiddler to monitor the commands and REST calls that are executed by the Microsoft Azure Command-Line Interface (CLI) you may find you hit this error.

Using the Azure Command-Line Interface (CLI) behind Fiddler - [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate

The Azure Command-Line Interface (CLI) does use the built in system certificates in the machine store that you probably updated when you installed Fiddler and instead you need to up a configuration file.



  • In the certificates MMC find the DO_NOT_TRUST_FidderRoot certificate, right click, and select All Tasks > Export.



  • Select to not export the private key.

  • Select BASE-64 encoded X.509 (.CER) and select a file location to export the file


  • If you don't have the certficate in here you can goto Fiddler goto Tools > Options > HTTPS > Actions > Export Root Certificate to Desktop.



    • You can then import the certificate, then export it in BASE-64 encoding.

  • On the file that you exported in BASE-64 format



  • Open the file certificate roots used by the CLI in notepad.exe - by default this is in this location.
    C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages\certifi\cacert.pem

  • Paste the exported certificate text to the end of the cacert.pem file and save the file.




  • Executing the Azure Command-Line Interface (CLI) commands should now work as expected.




Comments

Popular posts from this blog

Windows Server 2016, 2019, 2022, Windows 10 and Windows 11: Date and time "Some settings are managed by your organization".

TFTPD32 or TFTPD64 reports Bind error 10013 An attempt was made to access a socket in a way forbidden by its access permissions.

Enable function lock for F1-F12 on HP ZBook mobile workstations