Open Closed

CryptographicException: The system cannot find the file specified #6642


User avatar
0
darutter created
  • ABP Framework version: v8.0.2

  • UI Type: MVC

  • Database System: EF Core (SQL Server)

  • Tiered (for MVC) or Auth Server Separated (for Angular): no

  • Exception message and full stack trace:

  • Volo.Abp.AbpInitializationException: An error occurred during ConfigureServicesAsync phase of the module Volo.Abp.OpenIddict.AbpOpenIddictAspNetCoreModule, Volo.Abp.OpenIddict.AspNetCore, Version=8.0.1.0, Culture=neutral, PublicKeyToken=null. See the inner exception for details. ---> System.Security.Cryptography.CryptographicException: The system cannot find the file specified. at System.Security.Cryptography.X509Certificates.CertificatePal.FilterPFXStore(ReadOnlySpan`1 rawData, SafePasswordHandle password, PfxCertStoreFlags pfxCertStoreFlags)

  • Steps to reproduce the issue:

  • Create new abp.io commercial app using suite v8.0.2

  • Create both OpenIddict.pfx and authserver.pfx using appropriate pass phrase as defined in call to serverBuilder.AddProductionEncryptionAndSigningCertificate("openiddict.pfx", "

  • Deploy to Azure app service

  • set WEB_LOAD_CERTIFICATES=1and WEB_LOAD_USER_PROFILE=1 in app service configuration

  • verify that both openiddict.pfx and authserver.pfx files exist in /home/site/wwwroot

  • attempt to start website

  • receive exception

The process for configuring the certificate (AddProductionEncryptionAndSigningCertificate) hides the implementation and does not include the parameter X509KeyStorageFlags.MachineKeySet when creating the X509Certificate. On Azure it appears this parameter is required to enable proper loading of the cert.


7 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Also, please remember to copy openiddict.pfx to the Content Root Folder of the AuthServer website.

    Can you check this? https://docs.abp.io/en/abp/latest/Deployment/Configuring-OpenIddict#production-environment

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello,

    please check this https://support.abp.io/QA/Questions/5595

  • User Avatar
    0
    darutter created

    I got past the cryptographic issue and tried to run the iOS app (MAUI app) and am getting an AutoFac.Core.DependencyResolutionException. Autofac.Core.DependencyResolutionException: An exception was thrown while activating BCFOTest.Maui.App. ---> Autofac.Core.DependencyResolutionException: An exception was thrown while invoking the constructor 'Void .ctor(System.IServiceProvider)' on type 'App'. ---> Autofac.Core.DependencyResolutionException: An exception was thrown while activating BCFOTest.Maui.AppShell. ---> Autofac.Core.DependencyResolutionException: An exception was thrown while invoking the constructor 'Void .ctor(BCFOTest.Maui.ViewModels.ShellViewModel)' on type 'AppShell'. ---> Volo.Abp.Http.Client.AbpRemoteCallException: An error occurred during the ABP remote HTTP request. (An error occurred while sending the request.) See the inner exception for details. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: Error: TrustFailure --- End of inner exception stack trace ---

    How do I get past this?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    System.Net.WebException: Error: TrustFailure

    It looks like your HTTPS certificate is not trusted

  • User Avatar
    0
    darutter created

    I attempted to ask another question but got a message that my limit of 30 questions had been met. The 30 questions spans over 2 years and 2 subscriptions. When I repurchased my license in April of 2023 I would have expected that count to have been reset. It is ridiculous that the question count spans all years of my continued subscription. With each new release there are new issues and challenges that arise and not being able to ask questions as those arise makes using your framework much less reasonable. I need to have my question count to be reset with each extension of my license.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    When I repurchased my license in April of 2023 I would have expected that count to have been reset. It is ridiculous that the question count spans all years of my continued subscription.

    Sorry for that, this may be a problem, you can send an email to support@abp.io and we will check it out

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    With each new release there are new issues and challenges that arise and not being able to ask questions as those arise makes using your framework much less reasonable

    Each version will have an official question: https://support.abp.io/QA/Questions/6260/Bugs--Issues-v80x If you encounter any problems, you can describe the problems you encountered under this question.

    If it is an ABP bug we will refund your ticket If your ticket is not returned you can contact me.

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11