Could not load the certificate private key. Please check the authentication certificate password is correct and try again.

Was helping a colleague connect to an Azure Key Vault to retrive a certificate, and use that to do HTTP authentication to SharePoint. He was following the instructions from another blog post.

The issue was that Flow would complain with the following error: “Could not load the certificate private key. Please check the authentication certificate password is correct and try again.”

Wasted an hour of my life on this until I hit upon the issue. Thanks to this blog post that showed me the way.

It looks like even though the Key Vault has the cert, and the Flow is able to retrieve that cert, and that cert is retrieved as Base64…

… the HTTP connector does not like that for some reason. So if I were to instead convert the PFX file to Base64 myself, and store that as a secret in the Key Vault and refer to that, everything works fine!

Assuming $pfxfile is the path to the PFX file (can be password protected), do the following:

This will output the PFX file as Base64. Copy paste that into the Key Vault as a new secret, retrieve that secret in the Flow and use it as the PFX file in the HTTP connector, and that’s it!