Closed mwkirk closed 11 years ago
From aaron...@gmail.com on December 10, 2011 19:20:09 Also, 'isProduction' is false, we are not using production destination.
From sype...@gmail.com on December 10, 2011 19:57:56 How many device ids are there in your list?
And could you provide the full log output for your attempt? (or at least the last 50 lines preceding the exception)
Thank you!
From aaron...@gmail.com on December 10, 2011 22:39:03 There is 1 deviceId in my list.
You can see above in my code I do the following:
Exception theProblem = notification.getException(); ... theProblem.printStackTrace();
The stack trace only yields:
java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:168) at com.sun.net.ssl.internal.ssl.InputRecord.readFully(InputRecord.java:293) at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:331) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:798) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1138) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:632) at com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.java:59) at java.io.OutputStream.write(OutputStream.java:58) at javapns.notification.PushNotificationManager.sendNotification(PushNotificationManager.java:404) at javapns.notification.PushNotificationManager.sendNotification(PushNotificationManager.java:352) at javapns.notification.PushNotificationManager.sendNotification(PushNotificationManager.java:322) at javapns.Push.sendPayload(Push.java:176) at javapns.Push.alert(Push.java:47) at com.omeda.mobile.APNSCommunicator.sendAPNSNotification(APNSCommunicator.java:101) at com.omeda.mobile.APNSCommunicator.main(APNSCommunicator.java:72)
Its really wierd, because like I said outside my companys network things work fine, but inside the network it errors out. Who/What would trigger a socket connection to close abruptly ? Again, the 3 way handshake seems to look okay (from what I am told) and I have wireshark sniffs available as well.
From sype...@gmail.com on December 10, 2011 23:33:24 I would like to see the log output from the library, not just the exception. The exception tells just part of the story, so the full log can be quite useful (because for now I can't tell what's wrong..). Thanks!
From aaron...@gmail.com on December 10, 2011 23:48:35 Where can I find these logs ?
From sype...@gmail.com on December 10, 2011 23:49:09 Please see the Troubleshooting wiki page on this site.
From aaron...@gmail.com on December 11, 2011 00:05:11 Please find attached, thanks so much, anything else I can get you please let me know. I will make myself available.
From aaron...@gmail.com on December 11, 2011 00:15:03 Would you like me to send you the logs for a successful submission as well (Outside my companys network)?
From sype...@gmail.com on December 11, 2011 00:17:00 From what I see in the log, JavaPNS does try to recover from the "java.net.SocketException: Connection reset, unexpected_message" error twice by trying again and again to reconnect and stream the message to the Apple server. Unfortunately, the same "unexpected_message" SSL error occurs at every attempt, and JavaPNS eventually throws the exception because it reached the maximum number of attempts configured.
I really can't help you any further, as it seems to be a problem involving your network or security environment which breaks the comlink for some reason. Could there be a proxy on your company's network which somehow intercepts SSL connections and maybe doesn't like the trust strategy used between the library and APNS? The fact that the library works outside of your network seems to be hinting toward that posibility also.
From aaron...@gmail.com on December 11, 2011 00:26:42 Thanks!
I sort of thought the same thing, but often times its easy to say "Hey Systems this is a firewall issue..", but if they can't fix it, then it leaves everyone in no-mans land.
a couple questions:
I am really not familiar with SSL connections and sockets, etc. If you were me, is there any explicit information from the logs I sent you that I could give them to point them in the correct direction ?
What is this "enexpected_message" error for example, can I google "unexpected_message SSL socket error" and get results, or do you think this is something custom to my companys network ?
Is there anything you are seeing I can use to verify that this is DEFINITELY happening on my companys side, ie we are closing the connection prematurely not Apple?
If you were me what would you tell the systems department.. ?
From sype...@gmail.com on December 12, 2011 15:56:56 I'm no SSL expert, but the first thing I'd do is to provide your IT department with a copy of the SSL log for an attempt that works outside of the network, and one that does not work inside the network. In order to make it easier for them to investigate the issue, I would probably exclude JavaPNS-specific log entries from the logs I'd provide them (leaving only the log output generated by Java's -Djavax.net.debug=all option.
If one attempt works outside of the network and one fails inside, they ought to investigate it and provide a solution (or at least an explanation)..
From sype...@gmail.com on December 13, 2011 14:52:53 Since your code works outside of your company network (hinting at a company network issue), I would suggest we close this issue. Do you agree?
From sype...@gmail.com on December 20, 2011 15:43:19 Bumping this issue.. May we close it?
From aaron...@gmail.com on December 20, 2011 16:59:09 Yes it ended up being a firewall issue.
From sype...@gmail.com on December 20, 2011 17:54:39 Excellent, thank you!
Closing.
Original author: aaron...@gmail.com (December 10, 2011 19:11:44)
What steps will reproduce the problem? 1.This is my code:
List<PushedNotification> notifications = Push.alert(message, certLocation, certPassword, isProduction, deviceIds);
What is the expected output? What do you see instead:
The notification is not sent, instead I get this stacktrace:
java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:168) at com.sun.net.ssl.internal.ssl.InputRecord.readFully(InputRecord.java:293) at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:331) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:798) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1138) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:632) at com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.java:59) at java.io.OutputStream.write(OutputStream.java:58) at javapns.notification.PushNotificationManager.sendNotification(PushNotificationManager.java:404) at javapns.notification.PushNotificationManager.sendNotification(PushNotificationManager.java:352) at javapns.notification.PushNotificationManager.sendNotification(PushNotificationManager.java:322) at javapns.Push.sendPayload(Push.java:176) at javapns.Push.alert(Push.java:47) at com.omeda.mobile.APNSCommunicator.sendAPNSNotification(APNSCommunicator.java:101) at com.omeda.mobile.APNSCommunicator.main(APNSCommunicator.java:72)
The ResponsePacket object is null as well.
I am using JavaPNS_2.1.1.jar
The thing is, this works outside my companys network. When I connect to my company's network over VPN or when sending notifications from our servers, it errors as described above. We are having a hard time figuring out whats going on.
It isn't clear whether the connection is being closed by Apple or by some process in our network that we are unaware of.
Can you point me in a direction or tell me what I might do to resolve this ?
I have a wireshark sniff available as well, if you would like to see that, I can email it.
I can be reached at amathias@omeda.com.
Original issue: http://code.google.com/p/javapns/issues/detail?id=95