You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have this method in a .NET (net6.0) application, to instantiate and return a digital certificate.
using framework.mstiCSharp.Extensions;using System;using System.Security.Cryptography.X509Certificates;namespace msti.newpro.Core.Services.ADMServices.Services
{publicstaticclassDigitalServices Certificate
{publicstatic X509Certificate2 GetX509Certificate2(stringBase64Certificate,stringPassword){try{byte[]decodedByteArray= Convert.FromBase64String(Base64Certificate);returnnew X509Certificate2(decodedByteArray, Password);}catch(Exceptionex){thrownew Exception("Error loading digital certificate: "+ ex.GetAllInnerExceptionMessage()+"\n"+"Base64: "+Base64Certificate);}}}}
Most of the time, it works fine. But sometimes and only sometimes, it throws the exception:
"The system cannot find the file specified"
I generated logs of the input parameters (Base64Certificate string, Password string) and there is no problem with them, they always have the expected values.
In the testing environment and on my local computer, we never had the problem. But in production, on an AWS EC2, running Windows Server 2019, we sometimes have this problem.
The text was updated successfully, but these errors were encountered:
URL(s)
https://github.com/dotnet/core/blob/main/release-notes/6.0/6.0.0/6.0.0.md
Description
I have this method in a .NET (net6.0) application, to instantiate and return a digital certificate.
Most of the time, it works fine. But sometimes and only sometimes, it throws the exception:
"The system cannot find the file specified"
I generated logs of the input parameters (Base64Certificate string, Password string) and there is no problem with them, they always have the expected values.
In the testing environment and on my local computer, we never had the problem. But in production, on an AWS EC2, running Windows Server 2019, we sometimes have this problem.
The text was updated successfully, but these errors were encountered: