alexalok / dotAPNS

dotAPNS is a library used to send push notifications to Apple devices using Apple Push Notification service via HTTP/2 API.
Apache License 2.0
114 stars 34 forks source link

System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. #88

Closed libuke closed 3 years ago

libuke commented 3 years ago

Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: fail: Microsoft.AspNetCore.Server.Kestrel[13] Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: Connection id "0HMAJ6797VAOE", Request id "0HMAJ6797VAOE:00000002": An unhandled exception was thrown by the application. Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: ---> System.IO.IOException: Unable to read data from the transport connection: Connection reset by peer. Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: ---> System.Net.Sockets.SocketException (104): Connection reset by peer Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: --- End of inner exception stack trace --- Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken) Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.GetResult(Int16 token) Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: at System.Net.Security.SslStream.gInternalFillHandshakeBufferAsync|182_0[TIOAdapter](TIOAdapter adap, ValueTask1 task, Int3> Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: at System.Net.Security.SslStream.ReceiveBlobAsync[TIOAdapter](TIOAdapter adapter) Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter adapter, Boolean receiveFirst, Byte[] reAuthenticationData, Boolean isA> Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Boolean async, Stream stream, SslClientAuthenticationOptions sslOptions, CancellationTo> Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: --- End of inner exception stack trace --- Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Boolean async, Stream stream, SslClientAuthenticationOptions sslOptions, CancellationTo> Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: at System.Net.Http.HttpConnectionPool.GetHttp2ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellatio> Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: at Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: at System.Net.Http.HttpClient.SendAsyncCore(HttpRequestMessage request, HttpCompletionOption completionOption, Boolean async, Boolean emitTelemetryStart> Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: at DotAPNS.ApnsClient.SendAsync(ApplePush push, CancellationToken ct) in /home/ubuntu/bark-server-dotnet/DotAPNS/ApnsClient.cs:line 129 Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: at BarkServerNet.Controllers.PushController.Push(ILogger1 logger, IDeviceServer server, IApnsService apnsService, Message message) in /home/ubuntu/bark> Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: at BarkServerNet.Controllers.PushController.Get(ILogger`1 logger, IDeviceServer server, IApnsService apnsService, String deviceKey, String title, String> Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: at lambda_method35(Closure , Object ) Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecut> Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.gAwaited|12_0(ControllerActionInvoker invoker, ValueTask1> Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task la> Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTas> Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next> Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) Jul 30 16:12:57 VM-8-14-ubuntu BarkServer[748]: at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication1 application)

alexalok commented 3 years ago

Please provide more context, i.e. include your library initialization code (make sure to strip all the sensitive info though).

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.