-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathWindows_HTTP2_RegHack.ps1
More file actions
19 lines (16 loc) · 1.06 KB
/
Windows_HTTP2_RegHack.ps1
File metadata and controls
19 lines (16 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#This script disables HTTP2 on Windows 2016 servers which can cause issues with authentication over the "Windows" IIS Authentication binding on some applications
$registryPath = "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\HTTP\Parameters"
$nameEnableHttp2Tls = "EnableHttp2Tls"
$typeEnableHttp2Tls = "REG_DWORD"
$valueEnableHttp2Tls = "0"
$nameEnableHttp2Cleartext = "EnableHttp2Cleartext"
$typeEnableHttp2Cleartext = "REG_DWORD"
$valueEnableHttp2Cleartext = "0"
If (!(Test-Path $registryPath)) {
New-ItemProperty -Path $registryPath -Name $nameEnableHttp2Tls -Value $valueEnableHttp2Tls -PropertyType $typeEnableHttp2Tls
New-ItemProperty -Path $registryPath -Name $nameEnableHttp2Cleartext -Value $valueEnableHttp2Cleartext -PropertyType $typeEnableHttp2Cleartext
}
else {
Set-ItemProperty -Path $registryPath -Name $nameEnableHttp2Tls -Value $valueEnableHttp2Tls -PropertyType $typeEnableHttp2Tls
Set-ItemProperty -Path $registryPath -Name $nameEnableHttp2Cleartext -Value $valueEnableHttp2Cleartext -PropertyType $typeEnableHttp2Cleartext
}