Download TLS Certificate in .pem file

Nathan Cattin 1 Reputation point
2022-02-24T09:10:31.79+00:00

Hello everyone,

I have a TLS certificate on Azure App Service (not managed by me) and I have to add it on my edge device to validate it when connecting. My edge device is a custom board with a STM32 MCU, and as I know I have to write the certificate in my code. It seems that the certificate has to be in .pem format to add it in my code. Here is how I can see my certificate :

177452-image.png

I have read this article but it does not explain how to convert my certificate to .pem file.

https://learn.microsoft.com/fr-fr/azure/app-service/configure-ssl-certificate-in-code

Do you have any other information or documentation about how to do that ? Thanks a lot in advance

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,981 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. ajkuma 28,036 Reputation points Microsoft Employee Moderator
    2022-02-25T20:37:27.343+00:00

    @Nathan Cattin ,

    You have stated that, the certificate is not managed by you. To better assist you on this, just to clarify, is this free App Service managed certificate (ASMC) or purchased App Service Certificate (ASC) or private certificate from a third-party provider uploaded by any other user (on your subscription co-admin or any of your peer managing the certificate).

    If it’s ASMC - it does not support usage as a client certificate by using certificate thumbprint.
    And, you will not be able to export your App Service Managed Certificates as they are managed by the platform.

    Based on your requirement, you may leverage ASC or any 3rd party certificate.

    Reference doc section:
    177906-image.png

    Additional info | Just to highlight:

    On App Service, to access a certificate in your app code, add its thumbprint to the WEBSITE_LOAD_CERTIFICATES app setting.

    As for as converting certificate file format, if it’s 3rd party certificate, you can ask your CA to provide the certificate in the required format. There are also third-party tools that can help you convert the certificate to the proper format.

    0 comments No comments

  2. Nathan Cattin 1 Reputation point
    2022-03-01T11:00:42.96+00:00

    Thank you for your answer,

    I have had some discussions with the guy in charge of Azure server for my company (I am responsible of the edge/client part), and I do not know how but he sent me the certificate that I must use on my device. I have this certificate in 2 files : one is a .cer file and the other is a .pfx file.

    What do I have to do now to have a .pem file ? Can I do it with one of the 2 files I have ?


  3. Nathan Cattin 1 Reputation point
    2022-03-07T07:35:30.267+00:00

    Daer Ajkuma, thank you for your time on my issue.

    Finally, my technician sent me the certificate under PFX format, and I simply had to use OpenSSL command line to convert it to PEM format. Now I will add it in my device (C language) and check if it work.


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.