WCF:需要帮助才能理解为什么我需要在客户端和服务上安装SSL证书?

时间:2018-06-07 18:47:07

标签: wcf wcf-security

我有一个WCF Web服务应用程序。有另一个Windows服务应用程序来使用它。

首先,我只在服务服务器上安装了ssl cert。

我一直收到此错误消息。 "无法与具有权限的SSL / TLS安全通道建立信任关系' dev.xxxxx.com'。"

我通过在已安装Windows服务应用程序的客户端上安装ssl cert来修复它。

我不明白为什么现在有效。为什么我需要在客户端服务器上安装ssl证书?

WCF服务配置:

  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <protocolMapping>
      <add binding="basicHttpsBinding" scheme="https" />
    </protocolMapping>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
    <bindings>
      <basicHttpBinding>
        <binding maxBufferSize="104857600" maxReceivedMessageSize="104857600"  sendTimeout="00:10:00">
        </binding>
      </basicHttpBinding>
    </bindings>

  </system.serviceModel>

客户端配置:

  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpsBinding_IIRSvc">
          <security mode="Transport">
            <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
          </security>
        </binding>

      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="https://dev.xxxxx.com/IRSvc.svc"
        binding="basicHttpBinding" bindingConfiguration="BasicHttpsBinding_IIRSvc"
        contract="irsvc.IIRSvc" name="BasicHttpsBinding_IIRSvc" />
    </client>
  </system.serviceModel>

0 个答案:

没有答案