cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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
v-yuazh-msft
Community Support
Community Support

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
Frequent Visitor

Is this resolved? I am facing the same issue.

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.

GabrielStJohn
Community Champion
Community Champion

Hello, @Anonymous!

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
Community Manager
Power Automate | Power Virtual Agents
Super User Program Manager



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
New Member

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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (3,672)