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?