Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting Connection Resets from apns server #360

Open
sidaxe opened this issue Sep 15, 2018 · 4 comments
Open

Getting Connection Resets from apns server #360

sidaxe opened this issue Sep 15, 2018 · 4 comments

Comments

@sidaxe
Copy link

sidaxe commented Sep 15, 2018

My application needs to push notifications to ios devices. I used Notoop java-apns 0.2.2 as java client for pushing notification.

I frequently get these errors in my log logged by monitorSocket thread.

2018-09-07 15:41:57.379 c.n.a.i.ApnsConnectionImpl [INFO] Exception while waiting for error code
 java.net.SocketException: Connection reset
 	at java.net.SocketInputStream.read(SocketInputStream.java:210) ~[?:1.8.0_131]
 	at java.net.SocketInputStream.read(SocketInputStream.java:141) ~[?:1.8.0_131]
 	at sun.security.ssl.InputRecord.readFully(InputRecord.java:465) ~[?:1.8.0_131]
 	at sun.security.ssl.InputRecord.read(InputRecord.java:503) ~[?:1.8.0_131]
 	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973) ~[?:1.8.0_131]
 	at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:930) ~[?:1.8.0_131]
 	at sun.security.ssl.AppInputStream.read(AppInputStream.java:105) ~[?:1.8.0_131]
 	at java.io.InputStream.read(InputStream.java:101) ~[?:1.8.0_131]
 	at com.notnoop.apns.internal.ApnsConnectionImpl$1MonitoringThread.run(ApnsConnectionImpl.java:114) [apns-0.2.2.jar:?]

I understand, This error is generated by MonitoringThread which listens on socket input stream for errors.( Apple only provides a response for error messages and then it closes the connection).
In my case , the connection gets reset before any response code is received and due to this , the client creates a new socket connection with apns server, but the sent message is lost.

What could be the possible reasons that apns server is resetting connection without sending any error codes? Many of my messages are getting lost this way.

@putuyuwono
Copy link

Any updates on this issue? Would you share any solution to this?

@petarov
Copy link

petarov commented Aug 11, 2020

@airobot60 It seems your APNS certificate is either expired or there's something wrong with how it's been generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@petarov @putuyuwono @sidaxe and others