webpro2 / javapns

Automatically exported from code.google.com/p/javapns
0 stars 0 forks source link

java.io.EOFException: SSL peer shut down incorrectly #55

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

I'm executing this example: http://code.google.com/p/javapns/wiki/WorkingExample

What is the expected output? What do you see instead?

I want to send a push notification.

What version of the product are you using? On what operating system?

javapns-jdk16-168, on Mac OS X 10.6.8.

Please provide any additional information below.

Calling:
pushManager.sendNotification(client, aPayload);
when the code reaches the line number 156 in the method sendNotification of the 
class PushNotificationManager, i get this Exception:

    javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
    java.io.EOFException: SSL peer shut down incorrectly

The following is the last fragment of my logs:

main, received EOFException: error
main, handling exception: javax.net.ssl.SSLHandshakeException: Remote host 
closed connection during handshake
main, SEND TLSv1 ALERT:  fatal, description = handshake_failure
main, WRITE: TLSv1 Alert, length = 2
[Raw write]: length = 7
0000: 15 03 01 00 02 02 28                               ......(
main, called closeSocket()
[2011-06-29 10:50:39,309]:[INFO ]:[javapns.back.PushNotificationManager] [178]- 
Attempt failed... trying again
preclose
main, called close()
main, called closeInternal(true)
[2011-06-29 10:50:39,309]:[DEBUG]:[javapns.back.SSLConnectionHelper] [154]- 
Returning Push SSLSocketFactory
[2011-06-29 10:50:39,309]:[DEBUG]:[javapns.back.SSLConnectionHelper] [234]- 
Returning Push SSLSocket
Allow unsafe renegotiation: false
Allow legacy hello messages: true
Is initial handshake: true
Is secure renegotiation: false
in finally
java.net.SocketException: Socket is closed
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkEOF(SSLSocketImpl.java:1284)
    at com.sun.net.ssl.internal.ssl.AppInputStream.read(AppInputStream.java:65)
    at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
    at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
    at java.io.InputStreamReader.read(InputStreamReader.java:167)
    at java.io.BufferedReader.fill(BufferedReader.java:136)
    at java.io.BufferedReader.readLine(BufferedReader.java:299)
    at java.io.BufferedReader.readLine(BufferedReader.java:362)
    at javapns.back.PushNotificationManager.sendNotification(PushNotificationManager.java:192)
    at Main.main(Main.java:52)

Any help is really appreciated,

Thanks,
Luca D.

Original issue reported on code.google.com by ldant...@gecod.com on 29 Jun 2011 at 8:53

GoogleCodeExporter commented 9 years ago
Any updates on this issue?  any fixes? workarounds?  I am having the same 
issue. 

Original comment by gopikris...@gmail.com on 16 Jul 2011 at 10:49

GoogleCodeExporter commented 9 years ago
There could be only two reasons for this issue ( AFAIK). either proxy or your 
p12 file is causing this issue!  check  system's network settings.. and check 
that you exported APNS certificate with the key associated with it ( you can 
find the key by clicking on the arrow in the left side of the certificate in 
KeyChain Access)

Original comment by gopikris...@gmail.com on 18 Jul 2011 at 12:39

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Is this issue still valid?   It is typical of a certificate or keystore issue 
though...

Original comment by sype...@gmail.com on 7 Sep 2011 at 4:25

GoogleCodeExporter commented 9 years ago
Issue suspected of being caused by invalid certificate chain or keystore for 
selected server (handshake failure).

Closing issue as no feedback was received by original poster since issue was 
reported.  
Please feel free to re-open if the issue is still valid.

Original comment by sype...@gmail.com on 14 Sep 2011 at 4:02

GoogleCodeExporter commented 9 years ago
Hi All,

I am facing the same issue, and the thing is that i have followed following 
steps to produce my certificate and key,

http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part
-12

Now the thing is that, in above link they provided a PHP sample which works 
perfectly and i can get the Notification on my Device, but when i try to 
implement it through JavaPNs (the simple one) it throws above mentioned error.

I am using JavaPNs 2.2, in Win 7 machine with JDK jdk1.6.0_05.

Original comment by darshwit...@gmail.com on 16 Jul 2012 at 6:59

GoogleCodeExporter commented 9 years ago
I'm getting the same error, but just sometimes, other times the push is being 
sent, so I don't think I have a certificate problem.

Original comment by jcesarmo...@gmail.com on 18 Mar 2015 at 11:34