Gregory
Gregory

Reputation: 131

Is there a way for Windows 7 to support TLS 1.3 (.NET 4.8)

As far as I have read Win7 doesn't support TLS1.3, although there is rare information on this. Is there a way for Windows 7 to support TLS1.3, and if so how to do it?

I have coded my application in .NET 4.8 which supports TLS1.3, but Windows 7 still fails to establish connection.

Upvotes: 13

Views: 10805

Answers (1)

Alexandru Dicu
Alexandru Dicu

Reputation: 1235

While you can use TLS 1.3 from a NET Framework 4.x application like this:

ServicePointManager.SecurityProtocol = (SecurityProtocolType)12288
                                 | (SecurityProtocolType)3072
                                 | (SecurityProtocolType)768;
                                 | (SecurityProtocolType)192;

it works only on newer OS versions. On a Windows 7 machine, TLS 1.3 is not supported by the OS itself. Not even using a newer NET version (NET 8 for example) can fix it. Unfortunately, this combination Windows 7 + NET Framework + TLS 1.3 is unsupported.

A non secure way of doing this (not recommended, but doable) is to use .htaccess file to not redirect a certain folder or file from http to https:

# Redirect all requests to https
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/unsecure/ #BUT NOT FOR THIS FOLDER
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Now, update the code to make requests to http://foo.bar/unsecure/myscript.php or http://foo.bar/unsecure/myinstaller.msi Requests made to these URLs are done over http and will work. Your website can use TLS 1.3 but files/scripts under unsecure folder can be requested also over http. Again, I would advise against this method since it is made over http, but if there is no other solution, this is a working one.

Upvotes: -1

Related Questions