From 5eec93372e11c551aa3f06385826ee90437b703e Mon Sep 17 00:00:00 2001 From: Joseph Bauser Date: Fri, 23 Feb 2024 16:47:40 -0500 Subject: [PATCH] Add back erroniously removed storing of the original SSL settings --- DSCResources/cChocoInstaller/cChocoInstaller.psm1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/DSCResources/cChocoInstaller/cChocoInstaller.psm1 b/DSCResources/cChocoInstaller/cChocoInstaller.psm1 index b47b0a4..8e13c48 100644 --- a/DSCResources/cChocoInstaller/cChocoInstaller.psm1 +++ b/DSCResources/cChocoInstaller/cChocoInstaller.psm1 @@ -158,7 +158,10 @@ function Get-FileDownload { # Set security protocol preference to avoid the download error if the machine has disabled TLS 1.0 and SSLv3 # See: https://chocolatey.org/install (Installing With Restricted TLS section) - # Since cChoco requires at least PowerShell 4.0, we have .NET 4.5 available, so we can use [System.Net.SecurityProtocolType] enum values by name. + # Since cChoco requires at least PowerShell 4.0, we have .NET 4.5 available, so we can use + # [System.Net.SecurityProtocolType] enum values by name. + $securityProtocolSettingsOriginal = [System.Net.ServicePointManager]::SecurityProtocol + $tlsVersions = [enum]::GetValues('Net.SecurityProtocolType') | Where-Object { $_ -ge 'Tls' } # Include TLS versions by default $tlsVersions.ForEach({[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor $_})