title: HTTPS web service call from form works and from inside IIS doesn't
body: <p>I have a Web App that in one of it's processes needs to call a https web service in an external server.</p>
  
  <p>When I make the call I get a this exception: <code>An error occurred while making the HTTP request to https://servicos.portaldasfinancas.gov.pt:701/sgdtws/documentosTransporte. This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server.</code> </p>
  
  <p>The inner exception is: <code>The underlying connection was closed: An unexpected error occurred on a send.</code></p>
  
  <p>In order to debug, I created a windows form application that used exactly the same code and did exactly the same call, and accessed the same certificate for the call. But on the windows form application the call goes through without a problem.</p>
  
  <p>I'm at a loss as to what could be causing the connection to fail from inside IIS and don't know what could be different between the two.</p>