mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
Enable TLS1.1 and TLS1.2 for win_package (#32184)
This commit is contained in:
committed by
Jordan Borean
parent
638de22b35
commit
f2023a84a6
@@ -36,6 +36,16 @@ if (-not $validate_certs) {
|
||||
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = { $true }
|
||||
}
|
||||
|
||||
# Enable TLS1.1/TLS1.2 if they're available but disabled (eg. .NET 4.5)
|
||||
$security_protcols = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::SystemDefault
|
||||
if ([Net.SecurityProtocolType].GetMember("Tls11").Count -gt 0) {
|
||||
$security_protcols = $security_protcols -bor [Net.SecurityProtocolType]::Tls11
|
||||
}
|
||||
if ([Net.SecurityProtocolType].GetMember("Tls12").Count -gt 0) {
|
||||
$security_protcols = $security_protcols -bor [Net.SecurityProtocolType]::Tls12
|
||||
}
|
||||
[Net.ServicePointManager]::SecurityProtocol = $security_protcols
|
||||
|
||||
$credential = $null
|
||||
if ($username -ne $null) {
|
||||
$sec_user_password = ConvertTo-SecureString -String $password -AsPlainText -Force
|
||||
|
||||
Reference in New Issue
Block a user