Thanks again Robert.

So much for trying to use the 'preferred' approach.  If it's not going to 
be fixed until > 4.1 it makes HttpsURLConnection pretty much useless for 
quite a while as far as I can tell.  Pity.  I assume the proxy setting in 
the APN is there for a reason and clearing it will disable internet access. 
 Could I even do that in code just for my process?

Makes you wonder what sort of testing this code goes through before it is 
released.

Sigh ...

Steve

On Thursday, August 9, 2012 10:43:56 AM UTC+10, Robert Greenwalt wrote:
>
> Not a dumb question - I thought of this after I sent the reply.  As an app 
> developer I'm not sure what you could do other than not use 
> HttpsURLConnection.  Maybe somebody else on this list has an opinion.  You 
> could clear the https proxy for your process, but if you're running behind 
> a firewall (wifi case) you may not be able to connect.
>
> R
>
>
> On Wed, Aug 8, 2012 at 5:18 PM, Steve Baldwin 
> <[email protected]<javascript:>
> > wrote:
>
>> Thanks for the reply Robert.
>>
>> Sorry for what is probably a dumb question but is there any way to 
>> implement a workaround using the patch or should I forget about using 
>> HttpsURLConnection - given that I have no control over if/when a proxy may 
>> be used.
>>
>> Regards,
>>
>> Steve
>>
>>
>> On Thursday, August 9, 2012 9:31:05 AM UTC+10, Robert Greenwalt wrote:
>>
>>> This is a known problem:
>>> http://code.google.com/p/**android/issues/detail?id=35050<http://code.google.com/p/android/issues/detail?id=35050>
>>>
>>> That link includes info to an AOSP fix that's already available.  This 
>>> should be included in a future release.
>>>
>>> R
>>>
>>>
>>> On Tue, Aug 7, 2012 at 1:32 PM, Steve Baldwin <[email protected]>wrote:
>>>
>>>>  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.comprovided 
>>>> 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-d...@**googlegroups.com
>>>>
>>>> To unsubscribe from this group, send email to
>>>> android-developers+**[email protected]
>>>> For more options, visit this group at
>>>> http://groups.google.com/**group/android-developers?hl=en<http://groups.google.com/group/android-developers?hl=en>
>>>>
>>>
>>>  -- 
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to 
>> [email protected]<javascript:>
>> To unsubscribe from this group, send email to
>> [email protected] <javascript:>
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>>
>
>

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

Reply via email to