I\'m trying to send push notifications to my device using javapns library in liferay. Here\'s the code:
private void pushNo
Set the following properties on the server
javax.net.ssl.keyStore=../keystore/keystoreFile.jks
javax.net.ssl.keyStorePassword=yourPassword
javax.net.ssl.trustStore=../keystore/keystoreFile.jks
javax.net.ssl.trustStorePassword=yourPassword
javax.net.debug=true
you can create your keystore using
keytool -genkey -alias myKeyStore -keyalg RSA -keystore /home/aniket/keystore/keystoreFile.jks
The javax.net.ssl.SSLHandshakeException
exception is usually thrown when the server you're trying to connect to does not have a valid certificate from an authorized CA.
Put simply, the server you're attempting to connect to is most likely using a self-signed certificate and you have to accomodate for that in your Java code. This involves creating a custom KeyStore
, etc. See this Stack Overflow answer for full implementation details.
This algo happens when for example the server only accept TLS and your client is trying to create a SSL connection... check also the server/client side config