在Transport SecurityMode中使用WebHttpBinding时,连接中断 [英] Connection interrupted when using WebHttpBinding in Transport SecurityMode
问题描述
然而,当我尝试通过Firefox访问该网站时,我想通过一个带有SecurityMode:transport(SSL)的WebHttpBinding实现一个合同。我只获得
在加载网页时,与localhost的连接中断。
配置文件如下:
< 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>
< / config>
如果主机在IIS中,网站安全在此情况下在端口443上使用SSL证书。
您还需要配置服务行为,以设置证书名称和存储。特别是在将wcf服务作为Windows服务托管时,需要为要使用的端口设置证书。例如vista中的httpcfg.exe或netsh。
请检查 MSDN配置HTTP和HTTPS
I want to expose an implementation of a contract over a WebHttpBinding with SecurityMode: transport (SSL).
However, when I try to access the site via Firefox, I only get
The connection to localhost was interrupted while the page was loading.
The config file is as follows:
<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>
If host within IIS, you need to configure the hosting website security to use an ssl certificate on port 443 in this case.
You also need to configure the service behavior to set the certificate name and store. Particularly when hosting the wcf service as windows services, the certificate needs to be set for the port that you want to use. for example httpcfg.exe or netsh in vista.
Check out MSDN Configuring HTTP and HTTPS
这篇关于在Transport SecurityMode中使用WebHttpBinding时,连接中断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!