Es konnte keine Zertifikatskette zu einer vertrauenswürdigen Stammautorität – Azure App Service – erstellt werdenC#

Ein Treffpunkt für C#-Programmierer
Guest
 Es konnte keine Zertifikatskette zu einer vertrauenswürdigen Stammautorität – Azure App Service – erstellt werden

Post by Guest »

Ich habe meine ASP.NET-App über Visual Studio für Azure App Service bereitgestellt und eine .pfx-Datei in den Code eingefügt, die auch für Azure App Service bereitgestellt wurde. Wenn ich jedoch versuche, eine externe API aufzurufen, die Anforderungen mithilfe des Zertifikats signiert, erhalte ich die folgende Fehlermeldung:
*Die Anwendung läuft auf meinem lokalen Windows-Computer einwandfrei.

Code: Select all

Server Error in '/' Application.

A certificate chain could not be built to a trusted root authority.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Security.Cryptography.CryptographicException: A certificate chain could not be built to a trusted root authority.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[CryptographicException: A certificate chain could not be built to a trusted root authority.]
System.Security.Cryptography.Pkcs.PkcsUtils.CreateBagOfCertificates(CmsSigner signer) +316270
System.Security.Cryptography.Pkcs.SignedCms.Sign(CmsSigner signer, Boolean silent) +259
System.Security.Cryptography.Pkcs.SignedCms.ComputeSignature(CmsSigner signer, Boolean silent) +425
Digi_Sign.PFX.PFX_signing_Json_Multiple_Pan.Sign(Byte[] data, X509Certificate2 certificate) in C:\Users\BhushanBhalerao\Downloads\DotNet_sample\DotNet_Codes\Digi_Sign\Digi_Sign\PFX_signing_Json_Multiple_Pan.aspx.cs:387
Digi_Sign.PFX.PFX_signing_Json_Multiple_Pan.btnvalidate_Click(Object sender, EventArgs e) in C:\Users\BhushanBhalerao\Downloads\DotNet_sample\DotNet_Codes\Digi_Sign\Digi_Sign\PFX_signing_Json_Multiple_Pan.aspx.cs:96
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +11628060
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +274
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1959
Durchgeführte Schritte:[/b]
  • Ich habe es mit der Kudu-Konsole überprüft und FTP, und ich kann bestätigen, dass die .pfx-Datei auf dem Server vorhanden ist.
  • Ich habe auch die .pfx< hinzugefügt /code>-Zertifikat im Zertifikatabschnitt des Azure App Service.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post