Skip to content

Commit

Permalink
Add back erroniously removed storing of the original SSL settings
Browse files Browse the repository at this point in the history
  • Loading branch information
calerojoeb committed Feb 23, 2024
1 parent eac51a5 commit 5eec933
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion DSCResources/cChocoInstaller/cChocoInstaller.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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 $_})

Expand Down

0 comments on commit 5eec933

Please sign in to comment.