Skip to content

Commit

Permalink
Update security protocol handling in test_all.ps1 for PowerShell 6+
Browse files Browse the repository at this point in the history
  • Loading branch information
robmoss2k committed Dec 10, 2024
1 parent d5d5b88 commit 3e0839c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions test_all.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,14 @@ $options = [ordered]@{
}
}

[System.Net.ServicePointManager]::SecurityProtocol = 3072 -bor
768 -bor
[System.Net.SecurityProtocolType]::Tls -bor
[System.Net.SecurityProtocolType]::Ssl3
# https://github.com/majkinetor/au/issues/142

if ($PSVersionTable.PSVersion.major -ge 6) {
$AvailableTls = [enum]::GetValues('Net.SecurityProtocolType') | Where-Object { $_ -ge 'Tls' } # PowerShell 6+ does not support SSL3, so use TLS minimum
$AvailableTls.ForEach({[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor $_})
} else {
[System.Net.ServicePointManager]::SecurityProtocol = 3072 -bor 768 -bor [System.Net.SecurityProtocolType]::Tls -bor [System.Net.SecurityProtocolType]::Ssl3
}

$global:info = updateall -Name $Name -Options $Options

Expand Down

0 comments on commit 3e0839c

Please sign in to comment.