0

I make soap client in VisualStudio. I try to send any request with X509Certificate. I got error:

System.ArgumentException: „The provided URI scheme 'http' is invalid; expected 'https'. Parameter name: via”

My custom binding code looked like this:

<customBinding>
        <binding name="myCustomBindingConfig">
                <security authenticationMode="CertificateOverTransport"
                          defaultAlgorithmSuite="Basic256"
                          requireDerivedKeys="true"
messageSecurityVersion="WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10">
                    </security>
                    <textMessageEncoding messageVersion="Soap11"></textMessageEncoding>
                    <httpsTransport maxReceivedMessageSize="2000000000" />
                </binding>
            </customBinding>

So I changed http to https, but another error occured:

System.ServiceModel.Security.SecurityNegotiationException: „Could not establish trust relationship for the SSL/TLS secure channel with authority 'services.pl'.”

This is test environment and service uses self signed certificate.

I've alredy tried adding:

     ServicePointManager.Expect100Continue = true;
     ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
     ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(AlwaysGoodCertificate);

at the top od my code, as it was mentioned here, but nothing happend (I still have the error). What can I do now?

1 Answers1

0

Please check the following points to troubleshoot problems:

  1. Have you used the correct name from the certificate?

  2. Do you have DNS and line-of-sight to the server?

  3. The new server machine have the clock set correctly ?

  4. Can you get SSL if you browse from the server to the soap service?

  5. Whether the certificate is installed in the correct location and whether the certificate trust chain issue is a problem.

  6. The server's machine-level proxy set correctly?

Jiayao
  • 510
  • 3
  • 7