APNS NetworkIOException SSLHandshake Failure in Centos with java version 1.6.0_37

405 Views Asked by At

I am facing a issue while pushing notification to APNS Servers for all apps present in my Linux Server.

It is able to Push Notifications sometime and sometime it throws error, Checked Certificates it is Ok.

I use java_apns to push notification.

Below is the Error which I encounter, Can anyone please help me solving this.

2016-04-13 10:15:41,245 [pool-1-thread-1] WARN  com.timeinc.ae.push.services.APNSService - com_timesmedia_countrylife_magazine Error posting to multiple devices
com.notnoop.exceptions.NetworkIOException: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
    at com.notnoop.apns.internal.Utilities.wrapAndThrowAsRuntimeException(Utilities.java:284)
    at com.notnoop.apns.internal.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:342)
    at com.notnoop.apns.internal.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:312)
    at com.notnoop.apns.internal.ApnsPooledConnection$2.call(ApnsPooledConnection.java:43)
    at com.notnoop.apns.internal.ApnsPooledConnection$2.call(ApnsPooledConnection.java:41)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:701)
Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:941)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1320)
    at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:698)
    at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:119)
    at java.io.OutputStream.write(OutputStream.java:75)
    at com.notnoop.apns.internal.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:328)
    ... 8 more
Caused by: java.io.EOFException: SSL peer shut down incorrectly
    at sun.security.ssl.InputRecord.read(InputRecord.java:482)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:922)
    ... 13 more

Any help would be greatly appreciated.

1

There are 1 best solutions below

0
Muazzam Ali On

My code was working fine with certificate and suddenly it stooped working with handshake failure.

We finally found the problem is when certificate is out side war file(some local folder.)

1) first test with apns_test (node test) if this will send test notification then you have problem with security configuration.

Finally put certificate with in the war file. if you are testing out side folder then you might face this problem.

This work with me when I put certificate with in the war file.