0

Please help to fix the error while consuming web service...... Additional information: An error occurred while making the HTTP request to https://pilot.Test.in/autoTest.asmx. This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server.

<system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="AutoCompleteSoap"
                    closeTimeout="00:01:00"
                    openTimeout="00:01:00"
                    receiveTimeout="00:10:00"
                    sendTimeout="00:01:00"
                    allowCookies="false"
                    bypassProxyOnLocal="false"
                    hostNameComparisonMode="StrongWildcard"
                    maxBufferSize="5000000"
                    maxBufferPoolSize="524288"
                    maxReceivedMessageSize="5000000"
                    messageEncoding="Text"
                    textEncoding="utf-8"
                    transferMode="Buffered" useDefaultWebProxy="true">
          <security mode="Transport">
            <transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
            <message clientCredentialType="Certificate" algorithmSuite="Default" />
          </security>
        </binding>
        <binding name="AutoCompleteSoap1" />
      </basicHttpBinding>
      <customBinding>
        <binding name="AutoCompleteSoap12">
          <textMessageEncoding messageVersion="Soap12" />
          <httpsTransport />
        </binding>
      </customBinding>
    </bindings>
    <client>
      <endpoint address="https://pilot.Test.in/autoTest.asmx"
        binding="basicHttpBinding" bindingConfiguration="AutoCompleteSoap"
        contract="ConcatinatePDF.AutoCompleteSoap" name="AutoCompleteSoap" />
      <endpoint address="https://pilot.Test.in/autoTest.asmx"
        binding="customBinding" bindingConfiguration="AutoCompleteSoap12"
        contract="ConcatinatePDF.AutoCompleteSoap" name="AutoCompleteSoap12" />
    </client>
  </system.serviceModel>
  • Did code ever work? If so when did it start to fail? You may have issues with TLS which does the authentication. Because of security issues five years ago it was decided to eliminate TLS 1.0/1.1 and require either TLS 1.2 or TLS 1.3. Microsoft finally did a security update in June to disable TLS 1.0/1.1 on servers. When companies started installing the updates many app started to fail due to many client still requesting TLS 1.0/1.1. The fix is to make clients request TLS 1.2 or TLS 1.3. – jdweng Aug 26 '20 at 13:06
  • The same code is working on local machine but after deployment it is not working. Please suggest work around or possible solution. Thanks. – Shailendra Mishra Aug 26 '20 at 14:28
  • You need to configure for TLS 1.2. See https://learn.microsoft.com/en-us/dotnet/framework/network-programming/tls#for-wcf-tcp-transport-using-transport-security-with-certificate-credentials. The default TLS version depends on the windows version and the Net version. – jdweng Aug 26 '20 at 14:59
  • Also see following. Do not OR 11 WITH 12. Only use 12 since 11 is not longer valid : https://learn.microsoft.com/en-us/dotnet/api/system.servicemodel.channels.sslstreamsecuritybindingelement.sslprotocols?view=dotnet-plat-ext-3.1#System_ServiceModel_Channels_SslStreamSecurityBindingElement_SslProtocols – jdweng Aug 26 '20 at 15:04
  • This may be a problem with the TLS version, you can refer to this link for the solution to this problem: https://stackoverflow.com/questions/2013880/wcf-error-this-could-be-due-to-the-fact-that-the-server-certificate-is-not-conf – Ding Peng Oct 16 '20 at 08:49

0 Answers0