Guard TLS 1.3 protocol assignment with try/catch fallback to TLS 1.2
This commit is contained in:
@@ -9,9 +9,9 @@ Author: Patrick Asmus
|
||||
Web: https://www.cleveradmin.de
|
||||
Repository: https://git.techniverse.net/scriptos/windows-updater.git
|
||||
License: MIT
|
||||
Version: 2.7.0
|
||||
Version: 2.7.1
|
||||
Date: 06.07.2026
|
||||
Modifications: Prefer TLS 1.3 with TLS 1.2 fallback for improved security
|
||||
Modifications: Guard TLS 1.3 protocol assignment with try/catch fallback to TLS 1.2
|
||||
#####################################################
|
||||
#>
|
||||
|
||||
@@ -24,7 +24,11 @@ if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdenti
|
||||
exit 1
|
||||
}
|
||||
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls13 -bor [Net.SecurityProtocolType]::Tls12
|
||||
try {
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls13 -bor [Net.SecurityProtocolType]::Tls12
|
||||
} catch {
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user