Notnoop/ java-apns push
I have a problem with the notnoop/java-apns. It refuses to send a push notification form the java server i have and i get the following error/exception:
com.notnoop.exceptions.NetworkIOException: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: : the trustAnchors parameter must be non-empty at com.notnoop.apns.internal.Utilities.wrapAndThrowAsRuntimeException(Utilities.java:268) at com.notnoop.apns.internal.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:173) at com.notnoop.apns.internal.ApnsServiceImpl.push(ApnsServiceImpl.java:46) at com.notnoop.apns.internal.AbstractApnsService.push(AbstractApnsService.java:52) at com.notnoop.apns.internal.ApnsServiceImpl.push(ApnsServiceImpl.java:36) at com.kaniti.server.notification.impl.AppleIphoneNotificationJob.run(AppleIphoneNotificationJob.java:221) at java.lang.Thread.run(Thread.java:662) Caused by: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: : the trustAnchors parameter must be non-empty at com.sun.net.ssl.internal.ssl.Alerts.get开发者_Python百科SSLException(Alerts.java:190) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1649) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1612) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1595) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1521) at com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.java:64) at java.io.OutputStream.write(OutputStream.java:58) at com.notnoop.apns.internal.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:161)
I'm using the same code, the same push certificate on different servers, and it is working, but not on mine! I cant seem to find out the cause of this problem. Has anyone experienced it before?
The following steps will help you to sort your problem out.
Steps: developer_identity.cer <= download from Apple mykey.p12 <= Your private key
Commands to follow:
openssl x509 -in developer_identity.cer -inform DER -out developer_identity.pem -outform PEM
openssl pkcs12 -nocerts -in mykey.p12 -out mykey.pem
openssl pkcs12 -export -inkey mykey.pem -in developer_identity.pem -out iphone_dev.p12
Final p12 that we will require is iphone_dev.p12 file and the passphrase.
Use this as your p12.This indeed is the solution. :)
You may resolve your problem with this other question : the trustAnchors parameter must be non-empty
Your problem is that Java cannot find the cert store, you may change the path of the store.
精彩评论