Skip to content

Instantly share code, notes, and snippets.

@nicksterx
Last active November 2, 2023 01:47
Show Gist options
  • Save nicksterx/8cabfd5c696bd23f8ab4f11ca112cb26 to your computer and use it in GitHub Desktop.
Save nicksterx/8cabfd5c696bd23f8ab4f11ca112cb26 to your computer and use it in GitHub Desktop.
Disable HTTP/2 Protocol on Windows 10 and Windows 2016 Desktops With some web browsers, you might encounter the error ERR_SPDY_PROTOCOL_ERROR when accessing a Windows 10 VADC or Windows 2016 VADC desktop. You can prevent this error by disabling the HTTP/2 protocol on the desktop.
#2017-20-04
#Disable HTTP/2 Protocol on Windows 10 and Windows 2016 Desktops
#With some web browsers, you might encounter the error ERR_SPDY_PROTOCOL_ERROR when accessing a Windows 10 VADC or Windows 2016.
#You can prevent this error by disabling the HTTP/2 protocol on the desktop.
#http://stackoverflow.com/a/31714461/2375884
#https://pubs.vmware.com/horizon-7-view/index.jsp?topic=%2Fcom.vmware.view-agent.directconnectionplugin.doc%2FGUID-BE0738EC-E35E-4215-8E1E-1F08F911D592.html
$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
}
@xFate07
Copy link

xFate07 commented Oct 25, 2023

Hi sir Can i ask where to code this one ?

@nicksterx
Copy link
Author

Hi sir Can i ask where to code this one ?

It’s powershell. Save the ps1 save execute it as admin or paste it into a admin powershell window

@xFate07
Copy link

xFate07 commented Oct 25, 2023 via email

@nicksterx
Copy link
Author

What is the error?

@xFate07
Copy link

xFate07 commented Oct 25, 2023

New-ItemProperty : Cannot find Path

@nicksterx
Copy link
Author

Did you fix it? What version of OS are you using?

@xFate07
Copy link

xFate07 commented Nov 2, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment