ios - Apns c# exception unable to read data from the transport connection an existing connection was forcibly closed by the remote host -


I am trying to send Apple Push Notification with valid P12 and token:

  Zero connect () {client = new TcpClient (); // Notify that we are connecting this var echo = this. Connecting; If (eoc! = Null) eoc (this.appleSettings.Host, this.appleSettings.Port); Try {Client.Connect (this.appleSettings.Host, this.appleSettings.Port); } Catch (Exceptional) {New Connection Free Option ("Connection to Host Failed", prior); } If (appleSettings.SkipSsl) {networkStream = client.GetStream (); } Other {stream = new SSL stream (Client. Gatestream (false), false, new remote curtain validation callback ((sender, cert, chain, SSL policyArror) = & gt; {return true;}), new local certification syllaback ((Sender, Targethost, locator, remotecut, acceptable iSCORE) = & gt; {return certificate;}); Try {stream.AuthenticateAsClient (this.appleSettings.Host, this certificate, System.Security.Authentication.SslProtocols.Tls, False); //stream.AuthenticateAsClient(this.appleSettings.Host); } Hold (System.Security.Authentication.AuthenticationException ex) {new connectionfilereplacement ("to fail as the SSL stream authentication client", prior); } If the (new! Stream.ISUMT official) new connection throw file exception ("failed to validate SSL stream", blank); If (! Stream.CanWrite) throw a new connection failer exception ("SSL stream is not writable", blank); NetworkStream = Stream; } // Start reading from the stream, asynchronous reader (); }}  

When I changed the line code: System.Security.Authentication.SslProtocols.Tls System. Security. Authentication.SslProtocols.Ssl3 I "Authentication failed because remote party is closed transport section"

How can I send an APN? SSL 3 has been thrown in the final form by the apple (among other) I


Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -