aspnetcore icon indicating copy to clipboard operation
aspnetcore copied to clipboard

ASP.Net Core 6 gRPC HTTP/2 client TLS problem.

Open khteh opened this issue 3 years ago • 11 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Describe the bug

I don't have any issue running both the gRPC HTTP/2 server and client on Ubuntu 22.04 but only on Windows 11. I generate the TLS cert from Ubuntu using openssl:

openssl genrsa -aes256 -passout pass:<password> -out server.key 4096
openssl rsa -in server.key -out server.key.insecure -passin pass:<password>
openssl req -new -newkey rsa:4096 -x509 -nodes -days 365 -keyout server.key -out server.crt -subj "/C=xx/ST=Country/L=Country/O=Organization Pte. Ltd./OU=Organization/CN=localhost/[email protected]" -passin pass:<password>
openssl pkcs12 -export -out /tmp/localhost.pfx -inkey server.key -in server.crt -certfile server.crt -passout pass:<password>

Client-side code:

    var httpHandler = new HttpClientHandler
    {
        ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator,
        //ServerCertificateCustomValidationCallback = (request, cert, chain, errors) => { return true; },
        SslProtocols = SslProtocols.Tls13
    };
    using var channel = GrpcChannel.ForAddress(grpcConfig.Endpoint, new GrpcChannelOptions { HttpHandler = httpHandler });
    MyGrpcServiceClient client = new MyGrpcServiceClient (channel);
    using var call = client.Upload();
    MyRequest request = new MyRequest ();
    byte[] data = await System.IO.File.ReadAllBytesAsync(args[0]);
    request.File = new File()
    {
        Content = ByteString.CopyFrom(data)
    };
    request.Type = expectedFiles[args[0]];
    await call.RequestStream.WriteAsync(request);
    await call.RequestStream.CompleteAsync();
    MyResponse response = await call;

Client-side exception:

Exception! Status(StatusCode="Unavailable", Detail="Error starting gRPC call. HttpRequestException: The SSL connection could not be established, see inner exception. IOException:  Received an unexpected EOF or 0 bytes from the transport stream.", DebugException="System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
 ---> System.IO.IOException:  Received an unexpected EOF or 0 bytes from the transport stream.
   at System.Net.Security.SslStream.<FillHandshakeBufferAsync>g__InternalFillHandshakeBufferAsync|189_0[TIOAdapter](TIOAdapter adap, ValueTask`1 task, Int32 minSize)
   at System.Net.Security.SslStream.ReceiveBlobAsync[TIOAdapter](TIOAdapter adapter)
   at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter adapter, Boolean receiveFirst, Byte[] reAuthenticationData, Boolean isApm)
   at System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions sslOptions, HttpRequestMessage request, Boolean async, Stream stream, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions sslOptions, HttpRequestMessage request, Boolean async, Stream stream, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.AddHttp2ConnectionAsync(HttpRequestMessage request)
   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.GetHttp2ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at Grpc.Net.Client.Balancer.Internal.BalancerHttpHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at Grpc.Net.Client.Internal.GrpcCall`2.RunCall(HttpRequestMessage request, Nullable`1 timeout)")

Expected Behavior

Same behaviour as running in Ubuntu 22.04 without error.

Steps To Reproduce

No response

Exceptions (if any)

Exception! Status(StatusCode="Unavailable", Detail="Error starting gRPC call. HttpRequestException: The SSL connection could not be established, see inner exception. IOException:  Received an unexpected EOF or 0 bytes from the transport stream.", DebugException="System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
 ---> System.IO.IOException:  Received an unexpected EOF or 0 bytes from the transport stream.
   at System.Net.Security.SslStream.<FillHandshakeBufferAsync>g__InternalFillHandshakeBufferAsync|189_0[TIOAdapter](TIOAdapter adap, ValueTask`1 task, Int32 minSize)
   at System.Net.Security.SslStream.ReceiveBlobAsync[TIOAdapter](TIOAdapter adapter)
   at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter adapter, Boolean receiveFirst, Byte[] reAuthenticationData, Boolean isApm)
   at System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions sslOptions, HttpRequestMessage request, Boolean async, Stream stream, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions sslOptions, HttpRequestMessage request, Boolean async, Stream stream, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.AddHttp2ConnectionAsync(HttpRequestMessage request)
   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.GetHttp2ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at Grpc.Net.Client.Balancer.Internal.BalancerHttpHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at Grpc.Net.Client.Internal.GrpcCall`2.RunCall(HttpRequestMessage request, Nullable`1 timeout)")

.NET Version

6.0.9

Anything else?

No response

khteh avatar Oct 06 '22 03:10 khteh

The client is getting a bad response from the server. To figure out what is going on we need to see logs on the server. Setup server logging with everything at a trace level and provide the logs.

Instructions: https://learn.microsoft.com/en-us/aspnet/core/grpc/diagnostics?view=aspnetcore-6.0#grpc-services-logging

JamesNK avatar Oct 06 '22 08:10 JamesNK

Exception thrown: 'System.IO.IOException' in System.Private.CoreLib.dll
'KyberlifeProduct.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.9\System.IO.MemoryMappedFiles.dll'. 
'KyberlifeProduct.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.9\System.Security.Cryptography.X509Certificates.dll'. 
'KyberlifeProduct.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.9\System.Security.Cryptography.Primitives.dll'. 
'KyberlifeProduct.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.9\System.Security.Cryptography.Cng.dll'. 
'KyberlifeProduct.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.9\System.Security.Cryptography.Encoding.dll'. 
'KyberlifeProduct.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.9\System.Collections.NonGeneric.dll'. 
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Private.CoreLib.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Sockets.SocketException' in Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Private.CoreLib.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Sockets.SocketException' in Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Private.CoreLib.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Sockets.SocketException' in Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Private.CoreLib.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Sockets.SocketException' in Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Private.CoreLib.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Sockets.SocketException' in Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Private.CoreLib.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Sockets.SocketException' in Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Private.CoreLib.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Sockets.SocketException' in Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Private.CoreLib.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Sockets.SocketException' in Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Private.CoreLib.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Sockets.SocketException' in Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Private.CoreLib.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Sockets.SocketException' in Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Private.CoreLib.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Sockets.SocketException' in Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Private.CoreLib.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Sockets.SocketException' in Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll
Exception thrown: 'System.OperationCanceledException' in System.Private.CoreLib.dll
Exception thrown: 'System.OperationCanceledException' in System.Private.CoreLib.dll
Exception thrown: 'System.OperationCanceledException' in System.Private.CoreLib.dll
Exception thrown: 'System.OperationCanceledException' in System.Private.CoreLib.dll
Exception thrown: 'System.OperationCanceledException' in System.Private.CoreLib.dll
Exception thrown: 'System.OperationCanceledException' in System.Private.CoreLib.dll
Exception thrown: 'System.OperationCanceledException' in System.Private.CoreLib.dll
Exception thrown: 'System.OperationCanceledException' in System.Private.CoreLib.dll
Exception thrown: 'System.OperationCanceledException' in System.Private.CoreLib.dll
Exception thrown: 'System.OperationCanceledException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Sockets.SocketException' in Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll
Exception thrown: 'System.Net.Sockets.SocketException' in Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll
The thread 0x36b4 has exited with code 0 (0x0).
The thread 0x6088 has exited with code 0 (0x0).
The thread 0x6eb8 has exited with code 0 (0x0).
The thread 0x4054 has exited with code 0 (0x0).
The thread 0x5b38 has exited with code 0 (0x0).
The thread 0x2f9c has exited with code 0 (0x0).
The thread 0x442c has exited with code 0 (0x0).
The thread 0x6c28 has exited with code 0 (0x0).
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Private.CoreLib.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Sockets.SocketException' in Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Private.CoreLib.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Sockets.SocketException' in Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Private.CoreLib.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Sockets.SocketException' in Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Private.CoreLib.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Sockets.SocketException' in Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll
The thread 0x45a0 has exited with code 0 (0x0).
The thread 0x6e9c has exited with code 0 (0x0).
The thread 0x4570 has exited with code 0 (0x0).
The thread 0x14ac has exited with code 0 (0x0).
The thread 0x66b8 has exited with code 0 (0x0).
The thread 0x2ca4 has exited with code 0 (0x0).
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Private.CoreLib.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Sockets.SocketException' in Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Private.CoreLib.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Sockets.SocketException' in Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Private.CoreLib.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Sockets.SocketException' in Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Private.CoreLib.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Sockets.SocketException' in Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Private.CoreLib.dll
Exception thrown: 'System.ComponentModel.Win32Exception' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Sockets.SocketException' in Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll

khteh avatar Oct 06 '22 09:10 khteh

Please follow the instructions at https://learn.microsoft.com/en-us/aspnet/core/grpc/diagnostics?view=aspnetcore-6.0#grpc-services-logging

The simplest way to get logs is to console logging output and then copy console output. Console logging should be enabled by default.

JamesNK avatar Oct 06 '22 10:10 JamesNK

I have the following in appsettings.Development.json:

    "Logging": {
        "LogLevel": {
            "Default": "Debug",
            "Grpc": "Debug",
            "System": "Debug",
            "Microsoft.AspNetCore": "Debug",
            "Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker": "Error"
        },
        "Debug": {
            "LogLevel": {
                "Default": "Debug"
            }
        },
        "Console": {
            "IncludeScopes": true,
            "LogLevel": {
                "Microsoft.AspNetCore.Mvc.Razor.Internal": "Debug",
                "Microsoft.AspNetCore.Mvc.Razor.Razor": "Debug",
                "Microsoft.AspNetCore.Mvc.Razor": "Error",
                "Default": "Debug"
            }
        },
        "EventSource": {
            "LogLevel": {
                "Microsoft": "Debug"
            }
        },
        "EventLog": {
            "LogLevel": {
                "Microsoft": "Debug"
            }
        }        
    }

But don't see any grpc log in the console.

khteh avatar Oct 06 '22 10:10 khteh

@khteh Can you confirm whether you see any Kestrel logs in your console? Kestrel handles the TLS handshake that seems to be failing.

adityamandaleeka avatar Oct 07 '22 20:10 adityamandaleeka

No logs

khteh avatar Oct 07 '22 23:10 khteh

Same setup and I see the logs in Ubuntu. Not Windows 11.

khteh avatar Oct 09 '22 08:10 khteh

@khteh Are you running in development mode when you run on Windows? https://learn.microsoft.com/en-us/aspnet/core/fundamentals/environments?view=aspnetcore-6.0

adityamandaleeka avatar Oct 10 '22 22:10 adityamandaleeka

Development

khteh avatar Oct 12 '22 00:10 khteh

@khteh It sounds like you have everything configured and yet are not seeing the Kestrel logs which should give you more insight into what's happening.

I'm not sure why you wouldn't get the logs... can you share a project that shows this behavior (not getting logs when logging is enabled)?

adityamandaleeka avatar Oct 12 '22 22:10 adityamandaleeka

Hi @khteh. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

ghost avatar Oct 14 '22 20:10 ghost

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

See our Issue Management Policies for more information.

ghost avatar Oct 18 '22 21:10 ghost