title: self signed cert. The underlying connection was closed: Could not establish trust relationship
body: <p>Trying to set up a self signed certificate, for our intranet's web services site.  The certificate itself shows it is "ok" but when trying to invoke a method from the web service it throws an error, and also while adding the web reference it gives a warning.</p>
  
  <p>Here are the steps and some screenshots to make sure i provide accurate information.</p>
  
  <p>Windows server 2003. IIS. The web site is "WebServices.companyName.vmc"</p>
  
  <p><img src="https://i.stack.imgur.com/vI8iR.png" alt="1"></p>
  
  <p>Here is the host header for the site</p>
  
  <p><img src="https://i.stack.imgur.com/tfupk.png" alt="2"></p>
  
  <p>From the server, it shows the cert is 'ok'.</p>
  
  <p><img src="https://i.stack.imgur.com/pBunE.png" alt="enter image description here"></p>
  
  <p>Here are some of the site settings</p>
  
  <p><img src="https://i.stack.imgur.com/UkLNx.png" alt="enter image description here"></p>
  
  <hr>
  
  <p>Now, in visual studio 2008, adding the web reference</p>
  
  <p><img src="https://i.stack.imgur.com/l9Ke6.png" alt="enter image description here"></p>
  
  <p>Clicking 'Yes' to the popup</p>
  
  <p><img src="https://i.stack.imgur.com/9MrFD.png" alt="enter image description here"></p>
  
  <p>Clicking 'No' to this popup, several times sequentially.</p>
  
  <p><img src="https://i.stack.imgur.com/Wvq8I.png" alt="enter image description here"></p>
  
  <p>After the line of code runs, which calls the web service... i get this error</p>
  
  <blockquote>
    <p>The underlying connection was closed: Could not establish trust
    relationship for the SSL/TLS secure channel.</p>
  </blockquote>
  
  <p>And when webservice site in a browser, the little pad lock by the URL bar, provides this message:</p>
  
  <p><img src="https://i.stack.imgur.com/1ccpQ.png" alt="enter image description here"></p>
  
  <hr>
  
  <p>Here is my existing code:</p>
  
  <pre><code>Dim mySvc As New WebServices.InstantAccount
  mySvc.calledFunction()
  </code></pre>
  
  <hr>
  
  <hr>
  
  <p>EDIT</p>
  
  <p>For anyone with a similar issue, please read both iamkrillin's answer, and my answer... as they are both two different ways of solving the issue... depending on which part you can control (the code, or the cert).</p>