imnimit / javapns

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

Handshaking SSL issue #156

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. A very basic stand-alone Java program
2. java 1.6.0_37, bouncy castle 1.47, Mac OS X, javapans (latest 2.2)
3. token, certs all work on the sample PHP program, Java gives Handshake errors

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

0 [main] DEBUG javapns.notification.Payload  - Adding alert [hello from local]
744 [main] DEBUG javapns.communication.ConnectionToAppleServer  - Creating 
SSLSocketFactory
786 [main] DEBUG javapns.communication.ConnectionToAppleServer  - Creating 
SSLSocket to gateway.sandbox.push.apple.com:2195
1998 [main] DEBUG javapns.notification.PushNotificationManager  - Initialized 
Connection to Host: [gateway.sandbox.push.apple.com] Port: [2195]: 
1afd1810[SSL_NULL_WITH_NULL_NULL: 
Socket[addr=gateway.sandbox.push.apple.com/17.172.233.66,port=2195,localport=651
61]]
2001 [main] DEBUG javapns.notification.PushNotificationManager  - Building Raw 
message from deviceToken and payload
2001 [main] DEBUG javapns.notification.PushNotificationManager  - Built raw 
message ID 1 of total length 81
2002 [main] DEBUG javapns.notification.PushNotificationManager  - Attempting to 
send notification: {"aps":{"alert":"hello from local"}}
2002 [main] DEBUG javapns.notification.PushNotificationManager  -   to device: 
5063454c978ea7b2f7e94ed0f735d428db382a0f67f7c8779bc36bea3577c73a
2141 [main] INFO javapns.notification.PushNotificationManager  - Attempt failed 
(Received fatal alert: handshake_failure)... trying again
2141 [main] DEBUG javapns.communication.ConnectionToAppleServer  - Creating 
SSLSocket to gateway.sandbox.push.apple.com:2195
2178 [main] DEBUG javapns.notification.PushNotificationManager  - Attempting to 
send notification: {"aps":{"alert":"hello from local"}}
2178 [main] DEBUG javapns.notification.PushNotificationManager  -   to device: 
5063454c978ea7b2f7e94ed0f735d428db382a0f67f7c8779bc36bea3577c73a
2262 [main] INFO javapns.notification.PushNotificationManager  - Attempt failed 
(Received fatal alert: handshake_failure)... trying again
2263 [main] DEBUG javapns.communication.ConnectionToAppleServer  - Creating 
SSLSocket to gateway.sandbox.push.apple.com:2195
2305 [main] DEBUG javapns.notification.PushNotificationManager  - Attempting to 
send notification: {"aps":{"alert":"hello from local"}}
2305 [main] DEBUG javapns.notification.PushNotificationManager  -   to device: 
5063454c978ea7b2f7e94ed0f735d428db382a0f67f7c8779bc36bea3577c73a
2406 [main] ERROR javapns.notification.PushNotificationManager  - Attempt to 
send Notification failed and beyond the maximum number of attempts permitted
2407 [main] ERROR javapns.notification.PushNotificationManager  - Delivery error
javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
    at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
    at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:136)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1839)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1019)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1203)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:654)
    at com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.java:100)
    at java.io.OutputStream.write(OutputStream.java:58)
    at javapns.notification.PushNotificationManager.sendNotification(PushNotificationManager.java:402)
    at javapns.notification.PushNotificationManager.sendNotification(PushNotificationManager.java:350)
    at javapns.notification.PushNotificationManager.sendNotification(PushNotificationManager.java:320)
    at javapns.Push.sendPayload(Push.java:177)
    at javapns.Push.alert(Push.java:47)
    at tt.TestPush.main(TestPush.java:18)
2409 [main] ERROR javapns.notification.PushNotificationManager  - Delivery 
error: javax.net.ssl.SSLHandshakeException: Received fatal alert: 
handshake_failure
2409 [main] DEBUG javapns.notification.PushNotificationManager  - Reading 
responses
2410 [main] DEBUG javapns.notification.PushNotificationManager  - Closing 
connection

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

Java 1.6.0_37, bouncy castle 1.47, Mac OS X, javapns 2.2

Please provide any additional information below.

Original issue reported on code.google.com by amatij...@gmail.com on 5 Dec 2012 at 4:59

GoogleCodeExporter commented 8 years ago
I have same problem. java 1.6.0_24, Ubuntu12.04, javapans (latest 2.2).
Did you solve this problem?

Original comment by junwoo....@gmail.com on 8 Feb 2013 at 8:11

GoogleCodeExporter commented 8 years ago
Are you still experiencing this issue?  Have you solved your certificate chain 
problem?

Original comment by sype...@gmail.com on 1 Mar 2013 at 5:22

GoogleCodeExporter commented 8 years ago
Closing for lack of feedback from poster.

Original comment by sype...@gmail.com on 8 May 2013 at 9:26