2009-08-28 48 views
0

我想通过WebHttpBinding和SecurityMode:transport(SSL)公开实施合同。在传输中使用WebHttpBinding时,连接中断安全模式

然而,当我尝试访问通过Firefox浏览器的网站,我只得到

,而该页面被加载到本地主机的连接被中断。

的配置文件如下:

<configuration> 
    <system.serviceModel> 
    <services> 
     <service name="MyService"> 
     <endpoint address="https://localhost" 
        binding="webHttpBinding" 
        contract="MyService" 
        bindingConfiguration="secureWebHttp"> 
     </endpoint> 
     </service> 
    </services> 
    <bindings> 
     <webHttpBinding> 
     <binding name="secureWebHttp"> 
      <security mode="Transport"/> 
     </binding> 
     </webHttpBinding> 
    </bindings> 
    </system.serviceModel> 
</configuration> 

回答

1

如果IIS中的主机,你需要配置托管网站的安全性在这种情况下使用端口443上的SSL证书。

您还需要配置服务行为以设置证书名称和存储。特别是在将wcf服务作为Windows服务托管时,需要为您要使用的端口设置证书。例如vista中的httpcfg.exe或netsh。

结帐MSDN Configuring HTTP and HTTPS