OutOfMemoryException when starting gRPC call: The SSL connection could not be established

Viewed 36

I've started to receive OutOfMemoryException on a service running on dotnet6 that sends data through gRPC API. The service have been working fine till yesterday, when the error started. Error is not happening on used code at all. Anyone having a similar issue? Any clue about what could be happening? Here's the full stack trace.

"Status(StatusCode="Internal", Detail="Error starting gRPC call. HttpRequestException: The SSL connection could not be established, see inner exception. OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.", DebugException="System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.\n ---> System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.\n at System.Text.StringBuilder..ctor(Int32 capacity, Int32 maxCapacity)\n
at Internal.Cryptography.Pal.X500NameEncoder.X500DistinguishedNameDecode(Byte[] encodedName, Boolean printOid, Boolean reverse, Boolean quoteIfNeeded, String dnSeparator, String multiValueSeparator, Boolean addTrailingDelimiter)\n at Internal.Cryptography.Pal.X500NameEncoder.X500DistinguishedNameDecode(Byte[] encodedName, Boolean printOid, X500DistinguishedNameFlags flags, Boolean addTrailingDelimiter)\n at Internal.Cryptography.Pal.OpenSslX509CertificateReader.<>c.<get_Issuer>b__26_0(SafeX509Handle cert)\n at Internal.Cryptography.Pal.OpenSslX509CertificateReader.UseCertInteriorData[T](Func2 callback)\n at Internal.Cryptography.Pal.OpenSslX509CertificateReader.get_Issuer()\n at Internal.Cryptography.Pal.CachedSystemStoreProvider.<LoadMachineStores>g__ProcessFile|25_1(FileInfo file, <>c__DisplayClass25_0& )\n at Internal.Cryptography.Pal.CachedSystemStoreProvider.<LoadMachineStores>g__ProcessDir|25_0(DirectoryInfo dir, <>c__DisplayClass25_0& )\n at Internal.Cryptography.Pal.CachedSystemStoreProvider.LoadMachineStores(DirectoryInfo rootStorePath, FileInfo rootStoreFile)\n at Internal.Cryptography.Pal.CachedSystemStoreProvider.GetCollections()\n at Internal.Cryptography.Pal.CachedSystemStoreProvider.GetNativeCollections(SafeX509StackHandle& root, SafeX509StackHandle& intermediate)\n at Internal.Cryptography.Pal.OpenSslX509ChainProcessor.InitiateChain(SafeX509Handle leafHandle, X509Certificate2Collection customTrustStore, X509ChainTrustMode trustMode, DateTime verificationTime, TimeSpan remainingDownloadTime)\n at Internal.Cryptography.Pal.ChainPal.BuildChain(Boolean useMachineContext, ICertificatePal cert, X509Certificate2Collection extraStore, OidCollection applicationPolicy, OidCollection certificatePolicy, X509RevocationMode revocationMode, X509RevocationFlag revocationFlag, X509Certificate2Collection customTrustStore, X509ChainTrustMode trustMode, DateTime verificationTime, TimeSpan timeout, Boolean disableAia)\n at System.Security.Cryptography.X509Certificates.X509Chain.Build(X509Certificate2 certificate, Boolean throwOnException)\n at System.Net.Security.CertificateValidation.BuildChainAndVerifyProperties(X509Chain chain, X509Certificate2 remoteCertificate, Boolean checkCertName, Boolean isServer, String hostName)\n at System.Net.Security.SecureChannel.VerifyRemoteCertificate(RemoteCertificateValidationCallback remoteCertValidationCallback, SslCertificateTrust trust, ProtocolToken& alertToken, SslPolicyErrors& sslPolicyErrors, X509ChainStatusFlags& chainStatus)\n at System.Net.Security.SslStream.CompleteHandshake(ProtocolToken& alertToken, SslPolicyErrors& sslPolicyErrors, X509ChainStatusFlags& chainStatus)\n at System.Net.Security.SslStream.CompleteHandshake(SslAuthenticationOptions sslAuthenticationOptions)\n at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter adapter, Boolean receiveFirst, Byte[] reAuthenticationData, Boolean isApm)\n at System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions sslOptions, HttpRequestMessage request, Boolean async, Stream stream, CancellationToken cancellationToken)\n --- End of inner exception stack trace ---\n at System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions sslOptions, HttpRequestMessage request, Boolean async, Stream stream, CancellationToken cancellationToken)\n at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)\n at System.Net.Http.HttpConnectionPool.AddHttp2ConnectionAsync(HttpRequestMessage request)\n at System.Threading.Tasks.TaskCompletionSourceWithCancellation1.WaitWithCancellationAsync(CancellationToken cancellationToken)\n at System.Net.Http.HttpConnectionPool.GetHttp2ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)\n at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)\n at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)\n at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)\n at Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\n at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\n at Grpc.Net.Client.Balancer.Internal.BalancerHttpHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\n at Grpc.Net.Client.Internal.GrpcCall2.RunCall(HttpRequestMessage request, Nullable1 timeout)")"

0 Answers
Related