This is a migrated thread and some comments may be shown as answers.

AVD Chrome doesn't complete SSL handshake through Fiddler

3 Answers 112 Views
Windows
This is a migrated thread and some comments may be shown as answers.
Melissa
Top achievements
Rank 1
Melissa asked on 08 Aug 2020, 09:20 PM

I'm using Android Studio's AVD to run Chrome for Android.

I've installed the fiddler CA by going to http://<pc-ip>:<fiddler-port>, downloading the FiddlerRoot certificate, and Trusting that certificate through settings on the virtual device.

I've set up the device to proxy through Fiddler.

I can successfully load the Fiddler Echo Service, and http://example.com/.  Presumably all http-only traffic works, but it's hard to find examples online to test.

An example request to Google is 

CONNECT 172.217.4.67:443 HTTP/1.1
Host: 172.217.4.67:443

 

 

The response is 

HTTP/1.1 200 Connection Established
FiddlerGateway: Direct
StartTime: 15:53:05.999

 

No other traffic flows on the session, and it eventually times out with the 🚫 icon.

The Android device is continually polling to establish these connections.  When I disconnect the device from the proxy, Fiddler annotates the request:

CONNECT 172.217.9.35:443 HTTP/1.1
Host: 172.217.9.35:443
 
After the client received notice of the established CONNECT, it failed to send any data.

 

Fiddler prints a log message for each of these requests

[timestamp] Fiddler.Network.ProtocolViolation - [#XXX] HTTP/1.1 Request was missing the required HOST header.

I don't think this is an issue.  I understand it to mean that Chrome for Android doesn't supply a Host header, and as the pastes above show, Fiddler automatically inserts an appropriate one.

The symptom in Chrome for Android, then, is that when I try to access an https site, the browser hangs until it gives ERR_CONNECTION_REFUSED

I'm at a loss here.

 

 

3 Answers, 1 is accepted

Sort by
0
Melissa
Top achievements
Rank 1
answered on 08 Aug 2020, 09:24 PM

Forgot to mention:  I tried this user's solution, and you can see the effect in the response I pasted, that the Connection: Close header is gone now.  But it didn't resolve this issue.

https://www.telerik.com/forums/ssl-negotiation-doesn%27t-initiate-for-some-traffic#xgqDX_2woEGniyAmvOtKHg

0
Accepted
Nick Iliev
Telerik team
answered on 12 Aug 2020, 08:36 AM

Hello Melissa,

 

Are you experiencing the same issue on a real device? The AVDs are usually not having direct access to the network and are using special loopback addresses for localhost (something like 10.0.2.2) so it is likely that those should be set as a proxy in the advanced networking settings.

 

Regards,
Nick Iliev
Progress Telerik

0
Melissa
Top achievements
Rank 1
answered on 16 Aug 2020, 02:21 PM

Thanks for the feedback, Nick!

I used a real device, and sure enough, I was able to use Fiddler as expected.  So I went back to the AVD and found that there's one specific way I need to set up the proxy for the AVD to connect through fiddler.  I'll spell it out in case someone else has this same issue:

First, note that there's two ways to proxy your connection in AVD: Through the AVD options in the emulator's settings menu, and through the emulated Android OS in the same way that you would on a real device.  I found that the emulator proxy settings didn't work at all for me.  It would say "proxy successful", but then Android would fail to SSL handshake with Google to establish wifi connectivity.

So, I needed to set up the proxy in the Android OS instead.  To use the Android OS, I found that I have to first establish a connection to Android Wifi with proxy set to None.  Only then can I edit the connection to use the Fiddler proxy.  If I ever disconnect from Android Wifi, then I need to reconnect with proxy set to None, and then switch back to the Fiddler proxy while connected.

This works for me for now.  If I need to connect a different way, I'll bring the question to the Android Studio community; as you noted, it seems that the AVD connection wants to behave in very specific ways, but Fiddler is not causing a problem here.

Tags
Windows
Asked by
Melissa
Top achievements
Rank 1
Answers by
Melissa
Top achievements
Rank 1
Nick Iliev
Telerik team
Share this question
or