从浏览器外的 Silverlight 4 应用程序访问 HTTPS 内容
我正在使用 Silverlight 4.0 中提供的 COM 互操作功能来使用本地计算机的一些资源。因此,我自然需要具有提升权限的 OOB。但是,就我而言,我正在使用 HTTPS 通道上托管的 WCF 服务。这就是我面临问题的地方。应用了提升权限的 OOB 不允许我使用托管在不同或同一域上的 HTTPS 服务,从而给我一个 NotFound 异常。请注意,我在开发环境中使用了自签名证书。同样的也安装在我正在测试的客户端计算机的受信任根文件夹中。
有趣的是,当我设置 Fiddler 选项(在 Fiddler 会话中,Toos -> Fiddler 选项 -> HTTPS 选项卡)来拦截 HTTPS 流量并设置解密 HTTPS 流量复选框时,我能够使用相同的 HTTPS 服务,没有任何异常。但为此,Fiddler 告诉我将临时证书存储在我的用户配置文件的 Fiddler 目录中,并且当时我必须至少有一个 Fiddler 会话。因此,这似乎是一个认证问题。但它是否与使用所需证书签署 XAP 文件有关?我不知道。我尝试使用自签名证书并绑定我的图层服务 URL 以使用该证书。然后我将相同的证书安装到客户端的受信任根文件夹中。但我没有成功使用该证书签署 XAP。
如果您有任何解决方法,请告诉我。
I am using some of the local machine's resources using COM interop functionality provided in Silverlight 4.0. Hence, naturally I need OOB with elevated permissions. However, in my case I am consuming the WCF services hosted on HTTPS channel. Here is where I am facing the problem. The OOB with elevated permissions applied, doesn't allow me consuming the HTTPS service hosted on either different or the same domain, giving me a NotFound exception. Please note that I have used the self-signed certificate for the development environment. The same is also installed in the Trusted Root folder of the client machine on which I am testing.
Interestingly, when I set the Fiddler options (in Fiddler session, Toos -> Fiddler Options -> HTTPS tab) to intercept the HTTPS traffic, with Decrypt HTTPS traffic checkbox set, I am able to use the same HTTPS service without any exception. But for that, I was told by Fiddler to store a temporary certificate inside my user profile's Fiddler directory, and I must have at least one Fiddler session at that time. Hence, it seems to be a certification issue. But does it relate in anyway to signing of the XAP file with the required certificate ? I am not sure. I tried with a self-signed certificate and bind my layer service URL to use that certificate. Then I install the same certificate to Trusted root folder of the client. But i was not successful in signing the XAP with that certificate.
Please let me know if you have any work-around.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果代码在不同用户的上下文中运行,您需要将“自签名”证书放入机器受信任的根存储中。启动mmc.exe。在“文件”菜单上,选择“添加管理单元”。添加证书管理单元。选择本地计算机。将自签名根导入到受信任根存储中。
If the code is running in a different user's context, you need to put your "Self-signed" certificate into the Machine Trusted Root store. Start mmc.exe. On the File menu, choose to Add a Snap-in. Add the Certificates snap-in. Pick Local Machine. Import the Self-signed root into the Trusted Root store.
我遇到了同样的问题,发现是 IIS 中的 SSL 设置错误。
我将 IIS 7.5 配置为仅使用 SSL 并接受客户端证书。通过此设置,我最终在 OOB 中遇到了“找不到服务”错误。将 IIS 设置为忽略客户端证书后,OOB 应用程序可以正常工作。
I had the same problem and found out, that the SSL settings in IIS were wrong.
I configured IIS 7.5 to SSL only and to accept client certificates. With this settings, I ended up with the service not found error in OOB. After setting IIS to ignoring client certificates the OOB Application works fine.