Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
WCF-SSL服务_Wcf_Wcf Security - Fatal编程技术网

WCF-SSL服务

WCF-SSL服务,wcf,wcf-security,Wcf,Wcf Security,我有一个使用SSL的服务。当我尝试浏览到该服务时,出现以下错误: The SSL settings for the service 'SslRequireCert' does not match those of the IIS 'None'. 我的配置如下: <security mode="Transport"> <transport clientCredentialType="Certificate" /> </security&

我有一个使用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中验证)


你知道我还需要做什么吗?

修改你的行为以包括SSL,如下所示

<behaviors>
  <serviceBehaviors>
    <behavior name="MyService">
      <serviceMetadata httpGetEnabled="True" httpsGetEnabled="True" />
      <serviceDebug includeExceptionDetailInFaults="False" />
    </behavior>
  </serviceBehaviors>
</behaviors>

移除

<security mode="Transport">
        <transport clientCredentialType="Certificate" />
      </security>


这意味着您将使用证书身份验证

确定。看起来我需要更新applicationhost.config文件(在IIS Express中)。我为我的站点添加了一个位置,并设置sslFlags=“Ssl,SslAcceptCert,SslRequireCert”。这允许我启用SSL身份验证。然后,当我尝试使用客户端访问服务时,我收到一条消息,表明建立信任关系时出错。这是因为我的trusted people文件夹中没有服务器的证书(或者可能是客户端,我不确定,因为服务和客户端在我的本地PC上)。这样做之后,服务将正常工作,但是我们不想将证书交给客户端,因此我最终使用了TransportWithMessageCredential安全模式。

这与没有mex线路完全无关,除非它的配置不正确,在这种情况下,删除它将产生效果,但IIS仍可能给出相同的错误


确保IIS的SSL设置为“需要SSL”和“接受”(更容易)或“需要”用户证书,然后重新启动IIS。虽然IIS说更改是应用的-根据我的经验,它们并不总是-或者至少不是立即完成的

当我这么做的时候,我得到的信息是:没有端点在监听。如果我使用我的原始配置,但不使用TransportWithMessageSecurity,它可以工作。你可以在URL上浏览https吗?顺便说一下…我使用的是证书身份验证