Stage set-reset-tls.ps1

This commit is contained in:
Mike Ray
2024-03-12 09:31:11 -07:00
parent 265be93656
commit 44c9b2131a
2 changed files with 32 additions and 0 deletions
@@ -0,0 +1,5 @@
# Enable TLS 1.3 for SQL Server
[set-reset-tls.ps1](./set-reset-tls.ps1) demonstrates how you can set the registry setting to use specific encryption protocols.
Learn more at [Transport Layer Security (TLS) registry settings](https://learn.microsoft.com/windows-server/security/tls/tls-registry-settings?tabs=diffie-hellman).
@@ -0,0 +1,27 @@
# Learn more at https://learn.microsoft.com/en-us/windows-server/security/tls/tls-registry-settings?tabs=diffie-hellman
Set-StrictMode -Version Latest
$base = 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\'
$protocols = [ordered]@{
"SSL 2.0" = $false
"SSL 3.0" = $false
"TLS 1.0" = $false
"TLS 1.1" = $false
"TLS 1.2" = $true
"TLS 1.3" = $true
}
foreach ($version in $protocols.Keys) {
$enabledValue = $protocols[$version]
$path = $base + $version + '\Server'
New-Item $path -Force | Out-Null
New-ItemProperty -Path $path `
-Name 'Enabled' `
-Value $enabledValue `
-PropertyType 'DWord' `
-Force | Out-Null
Write-Host "$version is $enabledValue."
}