If you are trying to push notifications to apple devices with jdk 7 and using javapns plugin for pushing messages to Apple Server, You will end up getting the following error by using the p12 file generated using the keychain access in MAC.
Convert .p12 to jks:
keytool -importkeystore -destkeystore C:\Push_jks.jks -srckeystore C:\Push_j6.p12 -srcstoretype PKCS12
Convert jks to .p12:
keytool -importkeystore -srckeystore F:\Push_jks.jks -srcstoretype JKS -deststoretype PKCS12 -destkeystore C:\Push_j7.p12
Please provide the complete path of the files in place of C:\Push_j6.p12, C:\Push_j7.p12,F:\Push_jks.jks
Note : for reference i have used windows file paths in the above example.
javapns.communication.exceptions.InvalidCertificateChainException: Invalid certificate chain (Received fatal alert: certificate_unknown)! Verify that the keystore you provided was produced according to specs...The simple solution is, just convert APNS .p12 certificates to JKS file with jdk 6 keytool and again convert JKS back to .p12 format with jdk 7 keytool.
at javapns.notification.PushNotificationManager.sendNotification(PushNotificationManager.java:410)
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)
Convert .p12 to jks:
keytool -importkeystore -destkeystore C:\Push_jks.jks -srckeystore C:\Push_j6.p12 -srcstoretype PKCS12
Convert jks to .p12:
keytool -importkeystore -srckeystore F:\Push_jks.jks -srcstoretype JKS -deststoretype PKCS12 -destkeystore C:\Push_j7.p12
Please provide the complete path of the files in place of C:\Push_j6.p12, C:\Push_j7.p12,F:\Push_jks.jks
Note : for reference i have used windows file paths in the above example.
No comments:
Post a Comment