title: How to consume a SOAP service over HTTPS in C#?
body: <p>Webservice administrator gave me WSDL, two certificates and a private key:</p>
  
  <pre><code>service.wsdl
  ssl.cer
  auth_cert.pem
  auth_private_key.pem
  </code></pre>
  
  <p>In <em>Visual Studio 2010</em> I added a Web Reference (Service Reference didn't work) from the WSDL.
  Then I tried to use it as it was an http soap client:</p>
  
  <pre><code>MySoapClient client = new MySoapClient();
  client.Operation();
  </code></pre>
  
  <p>and I obtain this stack trace:</p>
  
  <pre><code>Unhandled Exception: System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel.
     at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)
     at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)
     at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
  </code></pre>
  
  <p>What I have to do with certificates and private key?<br />
  I can't find any tutorial online nor books that covers this matter. Any hint?</p>
  
  <p>Update</p>
  
  <p>Accessing the endpoint with <em>Firefox</em>:</p>
  
  <blockquote>
    <p>SSL peer cannot verify your
    certificate. (Error code:
    ssl_error_bad_cert_alert)</p>
  </blockquote>