32

The Charles SSL/HTTPS proxying was working fine on my Samsung Galaxy S5 phone.

I remove the certificate while not debugging because the phone warns me about the connection being monitored by a third party.

Now when I attempt to re-download the certificate from http://www.charlesproxy.com/getssl/ I get a charles-proxy-ssl-proxying-certificate.pem download failed due to network failures error:

charles-proxy-ssl-proxying-certificate.pem download failed due to network failures.

The phone is set up to use the Charles proxy. HTTP traffic can be inspected in Charles.

I'm running Charles 3.11.4 but I've also tested with 3.11.2. The phone is running Android 5.0

I tested with an LG Nexus 5 and the certificate downloaded and installed without any problems.

alexbirkett
  • 2,604
  • 2
  • 26
  • 30
  • I'm seeing the same here on a Nexus 5 running 5.1.1, trying the download with Chrome. I wonder if it was the recent update which broke it? – Andrew Ebling Mar 21 '16 at 14:12
  • I see the following ADB output when reproducing the issue (some duplicates trimmed to make it fit in a comment): D/DownloadManager: [2693] Starting V/NotificationService: pkg=com.android.providers.downloads canInterrupt=false intercept=true W/DownloadManager: [2693] Stop requested with status CANNOT_RESUME: can't know size of download, giving up D/DownloadManager: [2693] Finished with status CANNOT_RESUME – Andrew Ebling Mar 21 '16 at 15:25
  • 2
    I've contacted Charles Proxy support with a link to this question. Hopefully they will reply soon. – Andrew Ebling Mar 21 '16 at 15:53

8 Answers8

54

As a workaround, type this into your address bar and press Go.

data:text/html,<a href=http://www.charlesproxy.com/getssl/>Save This Link

Long-press on the link that appears and choose Save Link. Then open the certificate you downloaded.

Wesley
  • 10,652
  • 4
  • 37
  • 52
26

It's Chrome Mobile - try a different browser, Dolphin worked fine. Yet another thing Google broke in Chrome Mobile.

zark00
  • 276
  • 3
  • 2
  • 2
    Firefox allowed me to download the cert but it did not end up in the phone's user trusted credentials. Assume firefox has its own cert store. – alexbirkett Mar 22 '16 at 10:43
  • 2
    Correct - Firefox only installs to it's own cert store. I'll paste my revised Answer below. – Andrew Ebling Mar 22 '16 at 11:53
21

I manually worked around this issue by:

  1. Exporting the Charles certificate (Help > SSL Proxying > Export Charles Root Certificate and Private Key...) and setting a suitable password
  2. Copying the certificate to Google Drive
  3. Disabling the Manual Proxy setting on the Android device
  4. On the Android device going to Settings > Security > Install from storage
  5. Selecting the Google Drive account containing the certificate
  6. Selecting the certificate file and entering the password
  7. Selecting "VPN and Apps" for "Credential use"

The certificate was then loaded into the system-wide User credential storage and I was able to successfully SSL proxy the app I'm currently working on.

Andrew Ebling
  • 10,175
  • 10
  • 58
  • 75
  • 1
    Thanks @Andrew, I followed your steps and got it working too. – t3rse Mar 23 '16 at 15:46
  • 1
    I sent the certificate to my colleague's phone via Slack, then downloaded it from there. In this case I also encountered this problem: https://code.google.com/p/android/issues/detail?id=189785 ...where Install from storage > Downloads had everything greyed out. Solution was as in the link, browse to top-level device storage first then find the download folder and install the cert. – Anentropic Mar 24 '16 at 12:14
  • Best solution. After downloading firefox and trying the href solution I just figured out that it is easier export the certificate and install it. I used file transfer to save the certificate. Then just click on the device using the File Explorer and it works...You could update the answer with this option...Thanks – TomCobo May 09 '16 at 16:08
3

I did it very simply.

  1. Go to URL http://charlesproxy.com/getssl/
  2. In Charles, you should see a response from the server with the certificate. Like in this screen: https://i.stack.imgur.com/pe3z7.png

  3. Copy this text in txt file, and save it like *.cer

  4. Attach *.cer to email, and send it to a device.
  5. On your phone, you should click on the attached file and install the certificate.
  6. Profit!)
1

I was also getting charles-ssl-certificate-download-failed-due-to-network-failures error. I had updated charles to version 3.11.5 and then installed charles certificate on my mobile device.

It worked like a charm. I guess either in earlier version my browser was not configured to use charles proxy. Or there might be some issue in previous charles version.

Hope it helps :)

ajay
  • 886
  • 2
  • 12
  • 27
0

After a lot of struggle and swears, I found the problem that was going on with my Charles. I was getting network errors/failures due to long connections

It seems this was a problem from the additional connections created from my virtual machines. For anyone still stuck on this, to solve, instead of setting the IP in the Help-SSL Proxying-Install charles root ceritificate on a mobile device or remote browser, set your actual IP from windows. To get this, navigate to Network and Sharing centre - click on your current connection - Details - and then use the IP under IPv4 Address. Then use the HTTP port as configured in Charles.

0

It works to me by exporting SSL certificate to a file and copy this file to mobile device. Then install it from phone.

Check this post: http://go4test.blogspot.ca/2016/10/charles-proxy-failed-due-to-network.html

0

similar as Evgeniy Melnikov suggested.

  1. Exporting the Charles certificate (Help > SSL Proxying > Export Charles Root Certificate and Private Key...) and setting a suitable password
  2. from where the cert is saved at #1, attach to an email and send to an account which is accessible from the mobile.
  3. in the mobile mail client download the attached cert file (to Downlaod folder).
  4. in the mobile Setting > Security > install from storage, (or in some emulator Settings > Security > install from SD card) goto Downlaod folder and clicking on the downloaded cert file.

  5. Selecting the certificate file and entering the password.

  6. Selecting "VPN and Apps" for "Credential use"

after the cert is installed on the device, change the wifi settings to point to the machine the Charles in stalled and running.

lannyf
  • 9,865
  • 12
  • 70
  • 152