title: An error occurred while making the HTTP request to https -> Handshake failed
body: <p>I am consuming a webservice using a <code>basicHttpsbinding</code> as follows</p>
  
  <pre><code> EXCClient CreateClient()
      {
          var binding = new System.ServiceModel.BasicHttpsBinding();
          binding.ReaderQuotas.MaxArrayLength = int.MaxValue;
          binding.MaxReceivedMessageSize = int.MaxValue;
          binding.UseDefaultWebProxy = false;
          var endpoint = new System.ServiceModel.EndpointAddress("https://{siteName}/{service}");
  
          var client = new EXCClient(binding, endpoint);
          return client;
          //return new EXCClient();
      }
  </code></pre>
  
  <p>The consuming site is hosted on IIS 7.5 and has multiple sites located on the server. I am using .net forms site the calling code looks like the following</p>
  
  <pre><code>var x = service.Client.GetResults({parameter});
  </code></pre>
  
  <p>When running this service will return results for about 15 minutes and then begins to get this error.</p>
  
  <blockquote>
    <p>An error occurred while making the HTTP request to https://{siteName}/{service}/. 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  </p>
    
    <p>The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: The handshake failed due to an unexpected packet format.</p>
  </blockquote>
  
  <p>If I recycle the app pool for the site the service begins to return results again for about 15 minutes and then begins failing again. My app pool has no memory limitations put on it.</p>
  
  <p>The <code>app.config</code> looks like </p>
  
  <pre><code>&lt;bindings&gt;
      &lt;basicHttpBinding&gt;
          &lt;binding name="BasicHttpBinding_EXC"&gt;
              &lt;security mode="Transport" /&gt;
          &lt;/binding&gt;
          &lt;binding name="BasicHttpBinding_EXC1" /&gt;
      &lt;/basicHttpBinding&gt;
  &lt;/bindings&gt;
  &lt;client&gt;
      &lt;endpoint address="https://vadrs.tax.utah.gov/vdx/" binding="basicHttpsBinding"
          bindingConfiguration="BasicHttpBinding_EXC" contract="UTVehicleServices.EXC"
          name="BasicHttpBinding_EXC" /&gt;
  &lt;/client&gt;
  </code></pre>