"Unable to parse X5c certificate chain and locate leaf certificate" error when merging sign request

Charleen Cresin 0 Reputation points
2023-06-20T18:05:05.5366667+00:00

I'm trying to add a certificate in Key Vault from a non-integrated CA and I'm getting the following error when merging the signed request. I've tried uploading the certificate in PEM format (.cer extension), as well as adding the root, intermediate, and the end entity certificate in one file, but the same error is returned.

Import-AzKeyVaultCertificate: Operation returned an invalid status code 'BadRequest'

Code: BadParameter

Message: Unable to parse X5c certificate chain and locate leaf certificate

Azure Key Vault
Azure Key Vault
An Azure service that is used to manage and protect cryptographic keys and other secrets used by cloud apps and services.
1,283 questions
{count} votes

1 answer

Sort by: Most helpful
  1. JamesTran-MSFT 36,621 Reputation points Microsoft Employee
    2023-06-23T23:29:12.9133333+00:00

    @Charleen Cresin

    Thank you for your post!

    Error Message:

    Unable to parse X5c certificate chain and locate leaf certificate

    I understand that you're trying to add a certificate to your Key Vault from a non-integrated CA and are receiving the error message above when trying to merge and sign the request. To help point you in the right direction and hopefully resolve your issue, I'll share my findings below.

    Findings:

    Based off your error message, can you make sure that you're using the same CSR that you downloaded from the Azure Key Vault to generate the .cer and merge? Otherwise, if you're using a different .cer that was generated from another CSR, you'll run into this error message since the private and public key won't match.

    Additional Links:

    I hope this helps!

    If you have any other questions, please let me know. Thank you for your time and patience throughout this issue.


    If the information helped address your question, please Accept the answer. This will help us and also improve searchability for others in the community who might be researching similar information.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.