Lazy enable TLS 1.2 on Windows 7 / Windows 2008 R2 
Websites like github.com and others require minimum TLS 1.2 version, which is not enabled by default on older or not updated versions of Windows, like Windows 7 or Windows 2008 R2.
This script should be run as Administrator and requires PowerShell v2 and has been tested on Windows 7 Pro and Windows 2008 R2.
#ps1
function Enable-TLS12 {
$basepath = "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2"
$basepathClient = "$basepath\Client"
$basepathServer = "$basepath\Server"
New-Item -ItemType Directory -Path $basepath -Force
New-Item -ItemType Directory -Path $basepathClient -Force
New-Item -ItemType Directory -Path $basepathServer -Force
New-ItemProperty -Path $basepathServer -Name DisabledByDefault -Value 0 -PropertyType DWORD -Force
New-ItemProperty -Path $basepathServer -Name Enabled -Value 1 -PropertyType DWORD -Force
New-ItemProperty -Path $basepathClient -Name DisabledByDefault -Value 0 -PropertyType DWORD -Force
New-ItemProperty -Path $basepathClient -Name Enabled -Value 1 -PropertyType DWORD -Force
}
Enable-TLS12
# Some applications require to reboot your system afterwards
# shutdown -r -t 0 -f
That's all, folks!
Tweet