2

I am getting below error while trying to call webservice through UAT environment. However on my local it is working properly. I see some comment as it might be due to dummy cert but could not get the answer so posting it here . Also i am beginner to WCF . Please let me know how can i fix this .

what will be impact on production if i trust all by

//Trust all certificates
        System.Net.ServicePointManager.ServerCertificateValidationCallback =
            ((sender, certificate, chain, sslPolicyErrors) => true);

error says - System.ServiceModel.Security.SecurityNegotiationException: Could not establish trust relationship for the SSL/TLS secure channel with authority . ---> System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.

binding is

  <basicHttpBinding>
    <binding name="GLEditServiceSOAP" closeTimeout="00:01:00" openTimeout="00:01:00"
      receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
      bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
      maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
      messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
      useDefaultWebProxy="true">
      <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
      <security mode="Transport">
        <transport clientCredentialType="None" proxyCredentialType="None"
          realm="" />
        <message clientCredentialType="UserName" algorithmSuite="Default" />
      </security>
    </binding>

also wonder how it is working on my localhost.

4

1 回答 1

2

你可以在这里参考这篇文章。如帖子中所述,如果您使用 SSL 信任 URL,或者如果所有组件都托管在您公司的 Intranet 中,则在证书验证中始终返回 True 是安全的。

于 2013-05-21T10:51:53.270 回答