Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebRequest fails over TLS 1.1 / 1.2 for Windows Server 2008

Tags:

.net

ssl

I"m running a .net 4.5 application which makes secure outbound requests to an external server supporting only TLS 1.1 and TLS 1.2. All goes fine when i run the application from windows 8/8.1 host, but on Windows Server 2008 is fails with: "The underlying connection was closed: An unexpected error occurred on a send."

I believe that .net rely on underling OS infrastructure and because Windows Server 2008 does not support TLS 1.1 and TLS 1.2 the WebRequest also fails. Can somebody confirm that? Any documentation to point me to?

Code sample:

var request = WebRequest.Create("https://SOMEURL");
using (var response = (HttpWebResponse) request.GetResponse())
{
    using (var responseStream = response.GetResponseStream())
    {
         // read the stream
    }
}

I'm also setting the supported protocols:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
like image 268
kalitsov Avatar asked Jan 21 '26 13:01

kalitsov


1 Answers

because Windows Server 2008 does not support TLS 1.1 and TLS 1.2 the WebRequest also fails.

Yes, this is the case.

Any documentation to point me to?

From https://support.microsoft.com/en-us/kb/245030:

Windows Server 2008 supports the following protocols:
 SSL 2.0
 SSL 3.0
 TLS 1.0

Windows Server 2008 R2 and Windows 7 support the following protocols:
 SSL 2.0
 SSL 3.0
 TLS 1.0
 TLS 1.1
 TLS 1.2
like image 65
Steffen Ullrich Avatar answered Jan 24 '26 19:01

Steffen Ullrich



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!