从 Flex 连接到自签名 HTTPS Web 服务
在我的项目中,我需要连接到内网 Web 服务,但两台机器之间需要 SSL 连接。 由于这是一个内部网站点,因此 Web 服务的证书可能是自签名证书。 Web 服务和加载 Flex 应用程序的网页驻留在同一 Web 服务器(tomcat)上,因此当我使用 HTTPS 加载应用程序的网页时,系统要求我确认证书,我确认了它,但此确认不适用在 Flex 应用程序上(在 Internet Explorer 和 Firefox 上)。 我尝试了 Google 的 Chrome,它实际上要求我两次确认,一次用于网页,一次用于连接到网络服务,所以效果很好。
有没有办法告诉 Flash 播放器也接受自签名证书,这完全与浏览器有关,而 Adobe 人员对此无能为力吗? 换句话说,有没有办法从 Adobe Flex 连接到自签名证书 HTTPS Web 服务???
谢谢。
In my project I need to connect to an intra-net web service but we need SSL connection between the two machines.
Because this is an intra-net site the certificate of the web service might be a self-signed certificate.
The web service and the web page that loads my Flex application resides on the same web server (tomcat) so when I load the web page of the application with HTTPS I been asked to confirm the certificate, I confirm it but this confirmation does not apply on the Flex application (on Internet Explorer and Firefox).
I tried Google's Chrome and it actually asked me twice for confirmation, one for the web page and one for the connection to the web service so it worked great.
Is there a way to tell Flash player to accept also self-signed certificates of is it entirely concern the browser and Adobe guys can't do nothing about it?
In other words, is there a way to connect to a self-signed certificates HTTPS web services from Adobe Flex???
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
当我戴上安全帽时,答案是我希望不会。 我不希望浏览器插件绕过我的浏览器安全设置。 我认为这是一个漏洞。
对于独立的 Air 应用程序可能有一种方法,但在浏览器中 Flash 应该遵循浏览器设置。
When I put on my security hat the answer would be I hope not. I don't want browser plugins to bypass my browser security settings. I'd consider that a vulnerability.
There might be a way for standalone Air applications, but in browser Flash should honor browser settings.
在您的公司中,您可以创建自己的根 CA,将其证书添加到将访问 Intranet 的所有计算机,然后让 CA 向您的 Web 服务颁发证书。 该证书将不再是自签名的。 两个主要问题是:(1) 管理 CA 的私钥,(2) 将 CA 的根证书分发到客户端 PC。
In your company, you could create your own root CA, add its certificate to all machines that will access the intranet, and then have the CA issue your web service a certificate. The certificate will no longer be self-signed. The two main issues are: (1) managing the private key of your CA, (2) distributing the CA's root certificate to client PCs.
您需要下载证书并在 IE 和 Firefox 上安装它。
要在 IE 上安装证书:
http://www.markwilson.co.uk/blog/2008/11/trusting-a-self-signed-certificate-in-windows.htm
要在 FF 上安装证书:
转到“工具” -> 选项并单击加密选项卡。 单击“查看证书”,然后单击“导入”。
根据我的经验,必须在浏览器中验证或安装证书才能使 Flash 正常工作。 证书还需要有一个有效的主机名,但如果您需要这样做进行测试,您可以编辑客户端的主机文件。
You need to download the cert and install it on both IE and Firefox.
To install a cert on IE:
http://www.markwilson.co.uk/blog/2008/11/trusting-a-self-signed-certificate-in-windows.htm
To install a cert on FF:
Go to Tools->Options and click on the Encryption tab. Click "View Certificates", then "Import".
In my experience, the cert has to be either verified or installed in the browser in order to get Flash to work properly. The cert also needs to have a valid hostname, but you can just edit your client's hostfile if you need to do this for testing.
那么,Flash 播放器应该只使用浏览器来建立连接并完成它。 我们这里有类似的设置。 我们使用自制的证书,并通过 HTTPS 与 AMF 通道进行通信。 我的猜测是,我们的设置有所不同,因为我们通过 HTTPS 通道加载 Flash 应用程序本身,因此它是从 HTTPS 与同一个 HTTPS 服务器进行通信。 也许你可以尝试一下? 这是我们的 Tomcat 服务器的设置:
Tomcat 服务器/客户端自签名 SSL 证书
Well, the flash player should just use the browser to make the connection and be done with it. We have a similar setup here. We use self-made certs, and communicate with the an AMF channel over HTTPS. My guess is though that our setup is different in that we load the flash application itself over an HTTPS channel, so it's talking from HTTPS to the same HTTPS server. Maybe you could try that? This is the setup for our Tomcat server:
Tomcat Server/Client Self-Signed SSL Certificate