cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sveinhansen
Level: Power Up

Could not load the certificate private key

Hi all

 

I'm trying to call a REST API which requires the use of a Client Certificate to authenticate using the http action.

 

I'm base64 encoding the pfx file and are supplying the corresponding password but the flow fails with the error message: "Could not load the certificate private key. Please check the authentication certificate password is correct and try again."

 

I'm using the same certificate to access the api server programatically with no issues. The error message indicates to me that the action is not able to load and use the certificate/password correctly.

 

Have anyone gotting this authentication mechanism to work properly? If so, how did you generate the certificate you are using?

 

In advance, thanks!

 

-svein

6 REPLIES 6
Community Support Team
Community Support Team

Re: Could not load the certificate private key

Hi @ bangorkeith,

Could you please share a screenshot of the configuration of your flow?

Could you please share more details abou the issue that you meet?

 

The error message told that the flow could not load the certificate private key.

Please take a try to use base-64 encoding the certificate string refer to link below: 

https://docs.microsoft.com/en-us/azure/connectors/connectors-native-http

 

Please check the authentication certificate password is correct and try again,please let me know if your problem could be solved.

 

Regards,
Alice Zhang

esbharad
Level: Powered On

Re: Could not load the certificate private key

Is this resolved? I am facing the same issue.

ozawako1
Level: Powered On

Re: Could not load the certificate private key

I faced same issue and solved.

 

It seemed like base64 decoding did not work well.

so i stored my pfx file at one drive. 

and made flow step to read it.

and set it to pfx parameter.

 

it works.

Administrator
Administrator

Re: Could not load the certificate private key

Hello, @sveinhansen!

Have you had an opportunity to apply @ozawako1‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify!


Thank you for being an active member of the Flow Community!

-Gabriel
Flow Community Manager

-Gabriel
Microsoft Power Automate Community Manager
Are YOU a member of your local Power Automate User Group?
Fill out This Form to claim your Community User Group Member Badge!
_praveen
Level: Power Up

Re: Could not load the certificate private key

Hi,

It doesn't work for me... When i do that, i see an error " Unable to process template language expressions in action 'HTTP' inputs at line '1' and column '2850': 'Error reading string. Unexpected token: StartObject. Path 'pfx'.'." Please advise...

ObiWanCote
Level: Power Up

Re: Could not load the certificate private key

I've found a couple things that may help anyone reading this thread.  

 

  • You may have a problem if you are using a self-signed certificate. 
    • According to the documentation: The authentication type to use for Secure Sockets Layer (SSL) client certificates. While self-signed certificates are supported, self-signed certificates for SSL aren't supported.
  • The approach of Base64 encoding the contents of the pfx file works (if you're using a certificate signed by a trusted CA)
    • make sure you don't have any trailing newline characters when you copy the Base64 string
  • The approach of loading the pfx file in a previous action also works, but you still need to Base64 encode that output!
    • so in the pfx field of the HTTP Action, instead of just putting "File content" (i.e. the output from a "OneDrive get file content" action), use the base64 function to wrap the body of the file's contents... like this:
      • base64(body('Get_file_content'))
      • in this example "Get_file_content" is the name of the action that is getting the file content, but with underscores replacing the space characters

 

 

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Speakers, submit your sessions now! Call for speakers ends Feb. 10!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,586)