Using Charles Proxy to profile an Urban Airship Implementation

Profiling an application is a technical process. This is best completed by a developer or other technical resource.
If you are attempting to find Channel IDs and have a Urban Airship account level that includes technical support contact, please contact Urban Airship Support for a token that will allow easier access to the Channel ID with Urban Airship SDK 6.1 or later.
Because Charles Proxy exposes encrypted traffic to a 3rd party (in this case your computer), there are security concerns inherent in its use. We recommend using only Test Devices with Charles Proxy, and removing the Charles Proxy SSL Certificate after using Charles Proxy. Instructions for certificate removal are included at the bottom of this article.

About Charles Proxy:

Charles Proxy is a web debugging tool that allows you to pass HTTP/HTTPS traffic through your computer and view it. It's a great resource for figuring out what is happening with an Urban Airship implementation. 

 

Setting up Charles Proxy for Urban Airship:

  1. Download and Install Charles Proxy.
  2. Follow the Charles Proxy setup instructions for your platform.
  3. Once installed, open the Charles Proxy application on your computer.
  4. In Charles Proxy, go to the menu bar and choose Proxy > SSL Proxy Settings. Click the SSL Proxying tab.
  5. Click Add and enter device-api.urbanairship.com on port 443.
  6. Do the same with combine.urbanairship.com on port 443.
  7. Optionally, you can add *.urbanairship.com on port 443.
  8. Click OK.

Screen_Shot_2015-03-25_at_15.13.05.png

 

When connecting your iOS or Android devices to Charles Proxy, you may be presented with a popup asking for access.

Choose Allow.

allow_connections_safe.jpg

 

Device Setup:

Device traffic must be routed through your computer which is running Charles Proxy so that it can been read. This requires some configuration on your test device. This documentation provided by Charle Proxy's developers details the changes that need to be made. Please see the iOS and Android device sections:

BROWSER & SYSTEM CONFIGURATION

 

Profiling Application Behavior 

  1. At the top of the Charles main window, select Sequence.
  2. In the Filter box, enter urban to limit results to Urban Airship traffic.
  3. Open the mobile application on your device that you want to profile.
  4. Information should appear in the window. Congratulations!

Clicking an item under Sequence then selecting the Overview, Request, or Response tabs in the lower panel will display information about the traffic between the application and Urban Airship.

If you need to find a device identifier, see How to find a Device Identifier using Charles Proxy.

Information available here includes, but is not limited to

  • Device Tokens
  • APIDs
  • Channel ID
  • Tags
  • Alias
  • Rich Message User ID
  • Rich Message Inbox contents
  • App Key
  • Location Details

Saving a Session file to send to Urban Airship Support

A full session file is information-dense, and greatly preferred to screenshots of particular items.

To save the full session go to:

  1. File > Save 
  2. Format: Chales Session File
  3. Save to disk
  4. Attach to email or support ticket form

Removing the Charles Certificate from your device

Charles Proxy is a useful tool because it allows you to view HTTPS encrypted traffic that passes in and out of your device by installing a CA Certificate. 

However, this certificate can allow others to view encrypted traffic from your device.

For security reasons, we highly recommend that you remove the CA Certificate from your device after you are done using Charles Proxy. It is also a Best Practice to use Charles Proxy only with dedicated test devices.

It is also a Best Practice to use Charles Proxy only with dedicated test devices.

To Remove on iOS:

Go to:

  1. Settings
  2. General
  3. Profiles
  4. Charles Proxy SSL Proxying
  5. Tap Delete Profile

To Remove on Android:

Go to:

  1. Settings
  2. Security
  3. Trusted Credentials
  4. User
  5. XK72 Ltd (Charles Proxy SSL Proxying)
  6. Tap Remove

Related Content: