Per-Platform TLS Defaults in PowerShell Scripts (#353)

This commit is contained in:
Nick Banks 2020-05-03 18:06:38 -07:00 коммит произвёл GitHub
Родитель 1a4be0d89c
Коммит 970916f3d1
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 40 добавлений и 4 удалений

Просмотреть файл

@ -58,7 +58,7 @@ param (
[Parameter(Mandatory = $false)]
[ValidateSet("schannel", "openssl", "stub", "mitls")]
[string]$Tls = "schannel",
[string]$Tls = $null,
[Parameter(Mandatory = $false)]
[switch]$DisableLogs = $false,
@ -85,6 +85,15 @@ param (
Set-StrictMode -Version 'Latest'
$PSDefaultParameterValues['*:ErrorAction'] = 'Stop'
# Default TLS based on current platform.
if ($null -eq $Tls) {
if ($IsWindows) {
$Tls = "schannel"
} else {
$Tls = "openssl"
}
}
# Root directory of the project.
$RootDir = Split-Path $PSScriptRoot -Parent

Просмотреть файл

@ -40,7 +40,7 @@ param (
[Parameter(Mandatory = $false)]
[ValidateSet("schannel", "openssl", "stub", "mitls")]
[string]$Tls = "schannel",
[string]$Tls = $null,
[Parameter(Mandatory = $false)]
[switch]$KeepOutputOnSuccess = $false,
@ -62,6 +62,15 @@ param (
Set-StrictMode -Version 'Latest'
$PSDefaultParameterValues['*:ErrorAction'] = 'Stop'
# Default TLS based on current platform.
if ($null -eq $Tls) {
if ($IsWindows) {
$Tls = "schannel"
} else {
$Tls = "openssl"
}
}
# Root directory of the project.
$RootDir = Split-Path $PSScriptRoot -Parent

Просмотреть файл

@ -43,7 +43,7 @@ param (
[Parameter(Mandatory = $false)]
[ValidateSet("schannel", "openssl", "stub", "mitls")]
[string]$Tls = "schannel",
[string]$Tls = $null,
[Parameter(Mandatory = $false)]
[Int32]$Timeout = 60000,
@ -68,6 +68,15 @@ param (
Set-StrictMode -Version 'Latest'
$PSDefaultParameterValues['*:ErrorAction'] = 'Stop'
# Default TLS based on current platform.
if ($null -eq $Tls) {
if ($IsWindows) {
$Tls = "schannel"
} else {
$Tls = "openssl"
}
}
# Root directory of the project.
$RootDir = Split-Path $PSScriptRoot -Parent

Просмотреть файл

@ -83,7 +83,7 @@ param (
[Parameter(Mandatory = $false)]
[ValidateSet("schannel", "openssl", "stub", "mitls")]
[string]$Tls = "schannel",
[string]$Tls = $null,
[Parameter(Mandatory = $false)]
[string]$Filter = "",
@ -131,6 +131,15 @@ param (
Set-StrictMode -Version 'Latest'
$PSDefaultParameterValues['*:ErrorAction'] = 'Stop'
# Default TLS based on current platform.
if ($null -eq $Tls) {
if ($IsWindows) {
$Tls = "schannel"
} else {
$Tls = "openssl"
}
}
# Root directory of the project.
$RootDir = Split-Path $PSScriptRoot -Parent