Skip to content

Commit 9ee5894

Browse files
Merge pull request #57 from pester/enable-tls12
Enable TLS1.2 and 1.3 to allow greater security by default - fixes #54
2 parents fd165d6 + b7627e8 commit 9ee5894

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Extension/PesterTask/PesterV10/Pester.ps1

+3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ Write-Host "ScriptBlock $ScriptBlock"
6161
Import-Module -Name (Join-Path $PSScriptRoot "HelperModule.psm1") -Force
6262
Import-Pester -Version $TargetPesterVersion
6363

64+
# Enable use of TLS 1.2 and 1.3 along with whatever else is already enabled. If tests need to override it then they can do so within them or what they are testing.
65+
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 -bor [Net.SecurityProtocolType]::Tls13
66+
6467
if ($run32Bit -eq $true -and $env:Processor_Architecture -ne "x86") {
6568
Write-Warning "32bit support is considered deprecated in this version of the task and will be removed in a future major version."
6669
# Get the command parameters

Extension/PesterTask/PesterV9/Pester.ps1

+3
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ Write-Host "ScriptBlock $ScriptBlock"
6060
Import-Module -Name (Join-Path $PSScriptRoot "HelperModule.psm1") -Force
6161
Import-Pester -Version $TargetPesterVersion
6262

63+
# Enable use of TLS 1.2 and 1.3 along with whatever else is already enabled. If tests need to override it then they can do so within them or what they are testing.
64+
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 -bor [Net.SecurityProtocolType]::Tls13
65+
6366
if ($run32Bit -eq $true -and $env:Processor_Architecture -ne "x86") {
6467
# Get the command parameters
6568
$args = $myinvocation.BoundParameters.GetEnumerator() | ForEach-Object {

0 commit comments

Comments
 (0)