An error occurred while trying to HTTP request https & # 8594; Handshake

I am using webservice using basicHttpsbinding

as follows

 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();
    }

      

The resource site is hosted on IIS 7.5 and has multiple sites located on the server. I am using a .net forms site, the calling code is as follows

var x = service.Client.GetResults({parameter});

      

When started, this service will return results for about 15 minutes and then start this error.

An error occurred while transmitting the HTTP request https: // {siteName} / {service} /. This could be because the server certificate is not configured properly with HTTP.SYS in the case of HTTPS. It can also be caused by a security binding mismatch between client and server.

The connected connection was closed: An unexpected error occurred while sending. ---> System.IO.IOException: The handshake failed due to an unexpected packet format.

If I reuse the application pool for the site, the service starts returning results again for about 15 minutes and then crashes again. My application pool has no memory limit.

app.config

looks like

<bindings>
    <basicHttpBinding>
        <binding name="BasicHttpBinding_EXC">
            <security mode="Transport" />
        </binding>
        <binding name="BasicHttpBinding_EXC1" />
    </basicHttpBinding>
</bindings>
<client>
    <endpoint address="https://vadrs.tax.utah.gov/vdx/" binding="basicHttpsBinding"
        bindingConfiguration="BasicHttpBinding_EXC" contract="UTVehicleServices.EXC"
        name="BasicHttpBinding_EXC" />
</client>

      

+3


source to share


1 answer


The answer to this question was found in the post " How do I disable SSL fallback and only use TLS for outbound connections in .NET? (Pounds mitigation) ", I had other web service calls that set the following code with no return

System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Ssl3;

      



I had to set the protocol type to TLS as stated in the answer.

+5


source







All Articles