title: Exceprion - System.ServiceModel.Security.SecurityNegotiationException: „Could not establish trust relationship for the SSL/TLS secure channel
body: <p>I make soap client in VisualStudio. I try to send any request with X509Certificate.
  I got error:</p>
  <blockquote>
  <p>System.ArgumentException: „The provided URI scheme 'http' is invalid; expected 'https'. Parameter name: via”</p>
  </blockquote>
  <p>My custom binding code looked like this:</p>
  <pre><code>&lt;customBinding&gt;
          &lt;binding name=&quot;myCustomBindingConfig&quot;&gt;
                  &lt;security authenticationMode=&quot;CertificateOverTransport&quot;
                            defaultAlgorithmSuite=&quot;Basic256&quot;
                            requireDerivedKeys=&quot;true&quot;
  messageSecurityVersion=&quot;WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10&quot;&gt;
                      &lt;/security&gt;
                      &lt;textMessageEncoding messageVersion=&quot;Soap11&quot;&gt;&lt;/textMessageEncoding&gt;
                      &lt;httpsTransport maxReceivedMessageSize=&quot;2000000000&quot; /&gt;
                  &lt;/binding&gt;
              &lt;/customBinding&gt;
  </code></pre>
  <p>So I changed http to https, but another error occured:</p>
  <blockquote>
  <p>System.ServiceModel.Security.SecurityNegotiationException: „Could not establish trust relationship for the SSL/TLS secure channel with authority 'services.pl'.”</p>
  </blockquote>
  <p>This is test environment and service uses self signed certificate.</p>
  <p>I've alredy tried adding:</p>
  <pre><code>     ServicePointManager.Expect100Continue = true;
       ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
       ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(AlwaysGoodCertificate);
  </code></pre>
  <p>at the top od my code, as it was mentioned <a href="https://stackoverflow.com/questions/2859790/the-request-was-aborted-could-not-create-ssl-tls-secure-channel">here</a>, but nothing happend (I still have the error).
  What can I do now?</p>