>From what I read in the documentation, HttpURLConnection is preferred over 
>DefaultHttpClient for projects targeting Honeycomb or newer.

I am targeting API 15 for my project so started down this path.

(I connect to my server over https so was of course using HttpsURLConnection).

Everything worked great when talking to my server over WiFi but over 3g I was 
getting the following error in my Apache log :

Hostname 202.139.83.152 provided via SNI and hostname myserver.com provided via 
HTTP are different

The IP address is that of the proxy in the APN setting for my mobile carrier.

I dumped out the packets for a WiFi and 3g request and found that in the 
'Client Hello' packet the Handshake Protocol/Extension:server_name field 
contains the target hostname (myserver.com) for the wifi request but the APN 
proxy address for the 3g request.

(I'm using a stock Samsung Galaxy S3 running Android 4.0.4)

Using either the default browser or Chrome Beta, I can successfully hit the URL 
over 3g.

So, my questions are :

    * Do I need to make additional allowances in my code if the connection is 
over 3g and the APN
       includes a proxy setting?
    * Is there some misconfiguration on the part of my mobile carrier?
    * Is this a bug in the HttpsURLConnection code and if so, should I go back 
to using DefaultHttpClient?

Thanks,

Steve

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to