简体   繁体   English

无法从Android模拟器连接安全站点(“ https:”)

[英]Not able to connect secure sites (“https:”) from android emulator

I am working on a android application, which is accessing a secured (https://) web service for some data. 我正在使用一个Android应用程序,该应用程序正在访问安全(https://)网络服务以获取某些数据。 But I am facing some problem while testing the application in AVD emulator. 但是在AVD模拟器中测试应用程序时遇到了一些问题。 The problem is that I am not been able to access the "https:" site neither from my application nor from the emulator browser. 问题是我无法从应用程序或仿真器浏览器访问“ https:”站点。 While I am trying to connect the site (in fact any secured website ) from the browser it's showing the error message as " Data connectivity problem. A secure connection could not be established. ". 当我尝试通过浏览器连接该站点(实际上是任何受保护的网站)时,该错误消息显示为“ 数据连接问题。无法建立安全连接。 ”。 Though I can access the same websites from my window's web browsers. 虽然我可以从窗口的网络浏览器访问相同的网站。

According to my analysis the problem is with the privilege setting of the emulator. 根据我的分析,问题出在模拟器的权限设置上。 I am running the application on a corporate (my office) machine, where I don't have the admin rights (but I am a power user) and the machine is also behind the proxy. 我正在公司(我的办公室)计算机上运行该应用程序,但该计算机没有管理员权限(但我是超级用户),并且该计算机也位于代理服务器后面。 But as mentioned before I can access those secure sites from the machine's browsers, the only problem seems to be with the emulator accessibility. 但是如前所述,我可以从机器的浏览器访问那些安全站点,唯一的问题似乎在于模拟器的可访问性。

I tried to test the same code from my personal laptop and as expected it's working perfectly. 我试图从我的个人笔记本电脑上测试相同的代码,并且可以正常运行。

Can somebody please help me out to find out the solution for this? 有人可以帮我找出解决方案吗? How can I access a secured site from the emulator? 如何从模拟器访问安全站点? FYI I am using eclipse Helios & Android 2.1 仅供参考,我正在使用Eclipse Helios和Android 2.1

Please let me know if you need any more information from my side. 如果您需要我身边的更多信息,请告诉我。

Did you get a red warning screen when you try to access your secured website? 尝试访问受保护的网站时,是否出现红色警告屏幕? Because if you do, it would mean @Chirag Raval is correct. 因为如果这样做,那意味着@Chirag Raval是正确的。 You will need a SSL Certificate to connect to your secure site. 您将需要SSL证书才能连接到安全站点。

I was stuck with this problem for more than 4 weeks. 我被这个问题困扰了四个多星期。 And only solved it 3 days ago. 并且仅在3天前解决了。 I have then created a step-by-step tutorial to trust all https site. 然后,我创建了逐步教程以信任所有https网站。 Do check it out :) 请检查一下:)

http://droidos-coding.blogspot.com/2012/03/android-trusting-all-https-self-signed.html http://droidos-coding.blogspot.com/2012/03/android-trusting-all-https-self-signed.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM