Skip to content

Commit 44c9b21

Browse files
committed
Stage set-reset-tls.ps1
1 parent 265be93 commit 44c9b21

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Enable TLS 1.3 for SQL Server
2+
3+
[set-reset-tls.ps1](./set-reset-tls.ps1) demonstrates how you can set the registry setting to use specific encryption protocols.
4+
5+
Learn more at [Transport Layer Security (TLS) registry settings](https://learn.microsoft.com/windows-server/security/tls/tls-registry-settings?tabs=diffie-hellman).
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Learn more at https://learn.microsoft.com/en-us/windows-server/security/tls/tls-registry-settings?tabs=diffie-hellman
2+
Set-StrictMode -Version Latest
3+
4+
$base = 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\'
5+
$protocols = [ordered]@{
6+
"SSL 2.0" = $false
7+
"SSL 3.0" = $false
8+
"TLS 1.0" = $false
9+
"TLS 1.1" = $false
10+
"TLS 1.2" = $true
11+
"TLS 1.3" = $true
12+
}
13+
14+
foreach ($version in $protocols.Keys) {
15+
16+
$enabledValue = $protocols[$version]
17+
$path = $base + $version + '\Server'
18+
19+
New-Item $path -Force | Out-Null
20+
New-ItemProperty -Path $path `
21+
-Name 'Enabled' `
22+
-Value $enabledValue `
23+
-PropertyType 'DWord' `
24+
-Force | Out-Null
25+
26+
Write-Host "$version is $enabledValue."
27+
}

0 commit comments

Comments
 (0)