Redth / HttpTwo

A basic C# HTTP/2 client library
Apache License 2.0
120 stars 51 forks source link

Got an Exception while using it for apns token based trust in a production enviorment #14

Closed karsuszhang closed 7 years ago

karsuszhang commented 7 years ago

I use httptwo for apns token based trust. And it works fine in my dev enviorment(which is windows 10 pro, vs 2015). I can push my notice and my device can receive it. When I deploy the same code on the production env(aws server, windows server 2012r2), I got an exception when I send a push notice to apple.

System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> System.ComponentModel.Win32Exception: The message received was unexpected or badly formatted --- End of inner exception stack trace --- at System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult) at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result) at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at HttpTwo.Http2Connection.d20.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at HttpTwo.Http2Client.d19.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at HttpTwo.Http2Client.d17.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at HttpTwo.Http2MessageHandler.d2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at BTDDBServer.PushNotice.IOSNoticePusher.<Link>d__11.MoveNext() in D:\vsprojects\BeTheDealerServer\BTDDBServer\PushNotice\IOSNoticePusher.cs:line 182 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at BTDDBServer.PushNotice.IOSNoticePusher.d__9.MoveNext() in D:\vsprojects\BeTheDealerServer\BTDDBServer\PushNotice\IOSNoticePusher.cs:line 135

I also imported geotrust_global_ca to the server as apple said and not help. Any idea where went wrong? I guess it's some authorize problem but have no clue what it is. And I didn't do any special operation when I was coding as I remembered.

Thanks.

karsuszhang commented 7 years ago

found the problem, 2012r2 doesn't support http2……switch to 2016 than no that exception again