WCF-SSL 服务
我有一项使用 SSL 的服务。当我尝试浏览到该服务时,出现以下错误:
The SSL settings for the service 'SslRequireCert' does not match those of the IIS 'None'.
我的配置如下:
<security mode="Transport">
<transport clientCredentialType="Certificate" />
</security>
我正在使用 IIS Express,并且选中了“启用 SSL”(在 WebMatrix 中验证)。
有什么想法我还需要做什么吗?
I have a service that uses SSL. When I try to browse to the service I get the following error:
The SSL settings for the service 'SslRequireCert' does not match those of the IIS 'None'.
My config is as follows:
<security mode="Transport">
<transport clientCredentialType="Certificate" />
</security>
I am using IIS Express and I have "Enable SSL" checked (verified in WebMatrix).
Any ideas what else I need to do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
好的。看来我需要更新 applicationhost.config 文件(在 IIS Express 中)。我为我的网站添加了一个位置并设置 sslFlags="Ssl, SslAcceptCert, SslRequireCert"。这使我能够启用 SSL 身份验证。然后,当我尝试通过客户端访问该服务时,我收到一条消息,表明建立信任关系时出错。这是因为我的受信任人员文件夹中没有服务器的证书(或者可能是客户端,我不确定服务和客户端是否在我的本地 PC 上)。完成此操作后,服务将正常工作,但是我们不想将证书提供给客户端,因此我最终使用了 TransportWithMessageCredential 安全模式。
Ok. It looks like I needed to update the applicationhost.config file (in IIS Express). I added a location for my site and set sslFlags="Ssl, SslAcceptCert, SslRequireCert". This allowed me to enable SSL authentication. Then when I tried to access the service with a client I got a message that there was an error establishing a trust relationship. This was because I did not have the server's certificate in my trusted people folder (or it might have been the client, I'm not sure as the service and client is on my local PC). After doing that, the service will work, however we do not want to have to give our certificate to the client, so I ended up using the TransportWithMessageCredential security mode.
修改您的行为以包含 SSL,如下所示;
并删除
这意味着您将使用证书身份验证
Modify your behaviour to include SSL as below;
and remove
This is implying that you will be using certificate authentication
这与缺少 mex 行绝对无关,除非配置不正确,在这种情况下删除它会产生影响,但 IIS 仍然可能会给出相同的错误。
确保 IIS 的 SSL 设置为“需要 SSL”和“接受”(更简单)或“需要”用户证书 - 然后重新启动 IIS。尽管 IIS 表示已应用更改 - 根据我的经验,但并不总是如此 - 或者至少不会立即完成。
This has absolutely nothing to do with the absence of the mex line, unless it's configured incorrectly in which case removing it will have an effect but IIS still might give the same error.
Make sure IIS has SSL Settings of 'Require SSL' and 'Accept' (easier) or 'Require' user certificates - then RESTART IIS. Although IIS says changes are applied - im my experience they are not always - or at least not done immediately.