check tls version

This commit is contained in:
Roger Rutishauser 2024-10-24 14:56:05 +02:00
parent 9d5a83081a
commit 096a91a3d9

View File

@ -8,6 +8,38 @@ include_toc: true
Windows-R Tastenkombination, anschliessend `shell:startup`
## TLS Version aktiv/inaktiv?
```
# Function to check TLS version
function Test-TlsVersion {
param (
[string]$ComputerName = "localhost"
)
try {
# Test TLS 1.0
$tls10 = [System.Net.ServicePointManager]::SecurityProtocol -band [System.Net.SecurityProtocolType]::Tls10
# Test TLS 1.1
$tls11 = [System.Net.ServicePointManager]::SecurityProtocol -band [System.Net.SecurityProtocolType]::Tls11
# Test TLS 1.2
$tls12 = [System.Net.ServicePointManager]::SecurityProtocol -band [System.Net.SecurityProtocolType]::Tls12
Write-Host "TLS 1.0 Enabled: $($tls10 -ne 0)" -ForegroundColor Green
Write-Host "TLS 1.1 Enabled: $($tls11 -ne 0)" -ForegroundColor Green
Write-Host "TLS 1.2 Enabled: $($tls12 -ne 0)" -ForegroundColor Green
}
catch {
Write-Host "Error: $_" -ForegroundColor Red
}
}
# Check TLS versions on the local machine
Test-TlsVersion
```
## .NET
### .NET Version herausfinden