web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Business central Consuming a third-party endpoint that Required certificate

(0) ShareShare
ReportReport
Posted on by 85

Hi, 
I want to consume a third-party API in business central On-prem and the API has a requirement for Certificate, I have the certificate file and password but I am not able to use them. I have written code in C#, and it works correctly but I am not able to do the same in Business Central, here is my C# application code. 
pastedimage1670905961299v1.png

I am not able to understand how to pass this certificate in Business Central. I have written the code in AL but it's not working, I have explored some standard codeunit but not able to upload the certificate 

pastedimage1670906438580v2.png 
Anyone knows how to consume it, 
Best Regards 

I have the same question (0)
  • Suggested answer
    DAnny3211 Profile Picture
    11,423 Super User 2026 Season 1 on at

    hi

    in my opinion you'd better develop a dll in C# and put it in the addins of BC on prem and do whatever you need to do

    learn.microsoft.com/.../devenv-dotnet-controladdins

    DAniele

  • Verified answer
    Abdullah Zafar Profile Picture
    85 on at

    Hi, Yes that is an option as well, but I managed to get the desired result from business central standard functionality for Certifications, I have upload then certificate in business central and then used Base64 of the certificate, Some procedures that I have used have scope of On-prem, anyone who is trying it in SAAS, need to be careful,

    [quote user="DAnny3211"]

    hi

    in my opinion you'd better develop a dll in C# and put it in the addins of BC on prem and do whatever you need to do

    learn.microsoft.com/.../devenv-dotnet-controladdins

    DAniele

    [/quote]
  • Rebe.Gwaindepy Profile Picture
    216 on at
    Hi everyone,

    I have the same problem, @Abdullah did your AL solution work on SaaS? If yes, may you please assist me with how you management to save the certificate using BC functionality as well.

    Thanks,
    Kuda
  • Abdullah Zafar Profile Picture
    85 on at
    Hi @Rebe.Gwaindepy
    I resolved the issue, but It was for business central on-prem version, 
    I have replied to the post as well, you can take a look. 
  • Verified answer
    Rebe.Gwaindepy Profile Picture
    216 on at
    Hi Abdullah,
     
    Thanks for the response. The standard certificate management functionality does not work on SaaS. I managed to get it to work with a combination of both .Net and AL:
     
    • Use a .Net app or openssl to create a .pfx file of the certificate from the cert and key PEMs
    • Import the Certificate file manually and storing it in a custom Blob field:
    • Read the Blob and convert it to base64 to get certificate for http client
    • using the certificate with httpclient.addcertificate(certificate,password)
    I hopes this helps someone.
     
    Thanks
  • Abdullah Zafar Profile Picture
    85 on at

    Hi @Rebe.Gwaindepy
    This is indeed a great workaround, I have marked your reply as the answer., 
    Thanks for the valuable input.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,454 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,806 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,538

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans