Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Unanswered

API Integration - The remote certificate is invalid according to the validation procedure.

(1) ShareShare
ReportReport
Posted on by 35
Hello All,
 
I am working on a API POST HTTP web request integration from D365 FO to a third party service.
 
I have the digitally signed certificate from third party service. I have added the certificate in System admin - setup - key vault parameters and retrieved in code like below
 
 KeyVaultCertificateTable    certificateTableUnikCert       = KeyVaultCertificateTable::findByName(/****/); boolean                     unikCert                      = KeyVaultCertificateHelper::validateCertificate(certificateTableUnikCert.RecId); X509Certificate2            digitalCert                   = KeyVaultCertificateHelper::getDigitalCertificate(certificateTableUnikCert.RecId);
 
After this I have added the X509 certification to X509 certificate collection and assigned the certificate to Http web request. Even after attaching it gives me the error - /The remote certificate is invalid according to the validation procedure./ I have used the below code for this.
System.Security.Cryptography.X509Certificates.X509Certificate2Collection collection = new System.Security.Cryptography.X509Certificates.X509Certificate2Collection();collection.Add(digitalCert);httprequest.ClientCertificates = collection;
when i asked about this to my third party, they ask me to export and trust the certificate in D365 FO. But i am not sure how to do that. If any one had come across the same issue, let me know the ways to handle this.
 
thank you in advance
  • fsilva-jr Profile Picture
    fsilva-jr 20 on at
    API Integration - The remote certificate is invalid according to the validation procedure.
    What kind of certificate are you using? .pfx?...
    Was it added to your Azure Key Vault?
    Last time i got this error i spent one month to find out that the one who created the certificate was doing it wrongly...
  • API Integration - The remote certificate is invalid according to the validation procedure.
    Hello @monika, Were you able to resolve this issue related to Digital Signature?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans