Closed mwkirk closed 11 years ago
From sype...@gmail.com on February 13, 2012 05:09:56 The exception is pretty self-explanatory... did you produce the keystore following precisely the procedure described in the documentation? (http://code.google.com/p/javapns/wiki/PreparingCertificates)
From sype...@gmail.com on February 19, 2012 17:40:27 Is this issue resolved? May we close it?
From sype...@gmail.com on February 21, 2012 15:39:53 Closing for lack of feedback from original poster, and because the issue is most likely caused by a certificate chain not generated properly by user.
using jdk1.6, it is ok. but in jdk1.7, it does not work!
[DEBUG][2014-01-18 11:58:55,976]javapns.notification.Payload : Adding alert [Hello World!] [DEBUG][2014-01-18 11:58:56,496]javapns.communication.ConnectionToAppleServer : Creating SSLSocketFactory [DEBUG][2014-01-18 11:58:56,521]javapns.communication.ConnectionToAppleServer : Creating SSLSocket to gateway.sandbox.push.apple.com:2195 [DEBUG][2014-01-18 11:58:58,090]javapns.notification.PushNotificationManager : Initialized Connection to Host: [gateway.sandbox.push.apple.com] Port: [2195]: 19ff3900[SSL_NULL_WITH_NULL_NULL: Socket[addr=gateway.sandbox.push.apple.com/17.149.34.189,port=2195,localport=39352]] [DEBUG][2014-01-18 11:58:58,095]javapns.notification.PushNotificationManager : Building Raw message from deviceToken and payload [DEBUG][2014-01-18 11:58:58,096]javapns.notification.PushNotificationManager : Built raw message ID 1 of total length 77 [DEBUG][2014-01-18 11:58:58,096]javapns.notification.PushNotificationManager : Attempting to send notification: {"aps":{"alert":"Hello World!"}} [DEBUG][2014-01-18 11:58:58,096]javapns.notification.PushNotificationManager : to device: 595d83c6cea6b57b59d7175a42eecd7890d7d397ff38ae2dce6273ab929725bf [ERROR][2014-01-18 11:58:58,921]javapns.notification.PushNotificationManager : Delivery error: javapns.communication.exceptions.InvalidCertificateChainException: Invalid certificate chain (Received fatal alert: certificate_unknown)! Verify that the keystore you provided was produced according to specs... [DEBUG][2014-01-18 11:58:58,921]javapns.notification.PushNotificationManager : Reading responses [DEBUG][2014-01-18 11:58:58,922]javapns.notification.PushNotificationManager : Closing connection [DEBUG][2014-01-18 11:58:58,923]javapns.notification.Payload : Adding alert [Hello World!] [DEBUG][2014-01-18 11:58:58,923]javapns.notification.Payload : Adding badge [10]
I solved the issue in jdk 1.7 and using p12, just after changing the passwd length of p12 file greater than or equal 6. Otherwise, the following error happens: [[1] not transmitted to token 595d8..725bf javapns.communication.exceptions.InvalidCertificateChainException: Invalid certificate chain (Received fatal alert: certificate_unknown)! Verify that the keystore you provided was produced according to specs...]
Please add jssecacerts file to our $JAVA_HOME/lib/security/jssecacerts. It will solve the issue. Download from this link: https://github.com/notnoop/java-apns/wiki
Original author: send2tes...@gmail.com (February 13, 2012 04:40:22)
Hi, I'm new to javapns. I got the below exception when tried to access the code. I searched in the forum but couldnt get any useful tip to find out the reason. ERROR javapns.notification.PushNotificationManager - Delivery error : javapns.communication.exceptions.InvalidCertificateChainException: Invalid cer tificate chain (Received fatal alert: certificate_unknown)! Verify that the key store you provided was produced according to specs... This is the code i used to check the javapns. public static void main(String[] args) { try{ PushedNotifications notification = Push.alert("DNBiMobileAlert!", "D:/myfile.p12", "mypassword", false,"267ad2c53cae5d3e8dcb55fbb9b5e95f60f171c179d6131821fb9df29df55e0f"); System.out.println("Here :" + notification.isEmpty()); System.out.println("Response is:" + notification.toString()); }catch(Exception exp){ System.out.println("Exception Occurred" + exp.getMessage()); } }
Original issue: http://code.google.com/p/javapns/issues/detail?id=107