Connection interrupted when using WebHttpBinding in Transport SecurityMode

给你一囗甜甜゛ 提交于 2019-12-13 06:32:19

问题


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>

回答1:


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



来源:https://stackoverflow.com/questions/1345849/connection-interrupted-when-using-webhttpbinding-in-transport-securitymode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!