Another Sametime APNs test – resend push notifications

Following on from Sametime on iPhone – APNS test application I was sent another APNs test application during troubleshooting another STProxy/iPhone problem. This time you can return the certificate being used and also resend notifications to the device. The application can be obtained here.

Running the following will provide you with the details of the certificate being used which can be checked against Apple’s documentation.

/opt/IBM/WebSphere/AppServer/java/bin/java -jar apnstest.jar
Testing using default key
About to attempt to connect to APNS
Initialized SSL Context
SSL Socket Created
Starting SSL Handshake
SSL Handshake Complete
CN=gateway.push.apple.com, OU=iTMS Engineering, O=Apple Inc., L=Cupertino, ST=California, C=US
CN=Entrust Certification Authority – L1C, OU=”(c) 2009 Entrust, Inc.”, OU=www.entrust.net/rpa is incorporated by reference, O=”Entrust, Inc.”, C=US
Successfully Connected to APNS

To resend notifications, first of all you need to change the format of the APNs trace output to something meaningful such as Base-64. To do that you need to backup and then replace stproxyservices.jar with the edited version here. The location of the file is /AppServer/profiles/STPAppProfile/optionalLibraries/stproxy/stproxyservices.jar

Now add *=info:  com.ibm.rtc.stproxy.*=all: com.ibm.collaboration.realtime.*=all to the STProxyServer.

You will see that within trace.log that the text is now viewable with the Base-64 encoding. You will need to find the notification sent which will start with “sendMessageAPNS-B64″

[04/01/13 11:03:27:966 GMT] 0000003e APNSService   3   sendMessageAPNS-B64 (******************************************hB8+OIzkdBjW0wJEAaHsiYXBzIjp7ImFsZXJ0Ijp7I***************************************ZSI6MSwic291bmQiOiJkZWZhdWx0In19)

Using the same jar you can replay this notification with the following command.

/opt/IBM/WebSphere/AppServer/java/bin/java -jar ./apnstest.jar ******************************************hB8+OIzkdBjW0wJEAaHsiYXBzIjp7ImFsZXJ0Ijp7I***************************************ZSI6MSwic291bmQiOiJkZWZhdWx0In19
Testing using default key
About to attempt to connect to APNS
Initialized SSL Context
SSL Socket Created
Starting SSL Handshake
SSL Handshake Complete
CN=gateway.push.apple.com, OU=iTMS Engineering, O=Apple Inc., L=Cupertino, ST=California, C=US
CN=Entrust Certification Authority – L1C, OU=”(c) 2009 Entrust, Inc.”, OU=www.entrust.net/rpa is incorporated by reference, O=”Entrust, Inc.”, C=US
Successfully Connected to APNS
About to send message…
Parsed message:  ◄?q??T?j?$?0?qa?#9↔♠5??h{“aps”:{“alert”:{“loc-key”:”NEW_CHAT_MESSAGE”,”loc-args”:[“Ben  Williams”]},”badge”:1,”sound”:”default”}}
Sent message to APNS

All of the above was run on Linux.

Advertisements