Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Updated TLS logic to only add supported versions #233

Merged
merged 1 commit into from
Dec 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion AU/Public/Update-Package.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,12 @@ function Update-Package {
$global:Latest = @{PackageName = $package.Name}

# https://github.com/majkinetor/au/issues/206
[System.Net.ServicePointManager]::SecurityProtocol = 'Tls,Tls11,Tls12,Tls13' #https://github.com/chocolatey/chocolatey-coreteampackages/issues/366

$AvailableTls = [enum]::GetValues('Net.SecurityProtocolType') # This way we do not try to add something that is not supported on every version of Windows like Tls13
#$AvailableTls = [enum]::GetValues('Net.SecurityProtocolType') | Where-Object { $_ -ge 'Tls' } If we want to enforce a minimum version
$AvailableTls.ForEach({[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor $_})
Copy link

@ExE-Boss ExE-Boss Dec 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this includes [Net.SecurityProtocolType]::Ssl3, which is no longer supported in new environments (e.g.: PowerShell Core).


Refs: #206, #216




$module = $MyInvocation.MyCommand.ScriptBlock.Module
"{0} - checking updates using {1} version {2}" -f $package.Name, $module.Name, $module.Version | result
Expand Down