开发者

Proxy and SSL connections in android emulator

开发者 https://www.devze.com 2023-02-06 16:05 出处:网络
Would anyone know how to configu开发者_JAVA百科re the emulator to make ssl connections via a proxy ?

Would anyone know how to configu开发者_JAVA百科re the emulator to make ssl connections via a proxy ?

I use the -http-proxy option when starting the emulator. I can access any website except those with https protocol.

Any idea ?


I've experienced similar problems with Android during a web project lately. The site works fine using ordinary HTTP from Android but when using HTTPS it works now and then. Some requests just fail and we get "Web page not found"-errors. The connections are sometimes very slow. After some further tests and investigation I found out that the problem was general for all HTTPS sites, not only for our site.

According to a bug report for Android others are reporting the same problem and Android has been hit by it since version 1.5: http://code.google.com/p/android/issues/detail?id=3334

I removed the APN proxy in my HTC Desire, as stated in the bug report above, and then Android performed as expected on HTTPS sites. For our purpose we have made an exception for Android telephone so they are routed to the ordinary HTTP site instead.

In other words, it seems like Android has a general problem with proxies and that may be the cause of problem with the emulator. Vote on the bug, just follow the link above.


There are several possible reasons for that:

  • Can you access the HTTPS site with your real phone? If not, then probably the involved certificate is not considered as trusted from the app/webview. If you need to consider a certificate as trusted within your app, look at the following tutorial
  • Can you access HTTPS sites at all via your proxy from a webbrowser? Our enterprise proxy server does not allow HTTPS traffic (for whatever reason) at all. You could also sniff the traffic with Wireshark etc. to see if anything is sent back from the proxy or an error occurred.

What type of problem did you get when you try to connect to the website? Can you provide a stacktrace or LogCat output?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号