Update Test-ModsPath.ps1

Following the results of megaliner scan, we need to remove the hardcode of security protocols
pull/675/head
Andrzej Demski 2024-09-01 11:32:40 +02:00 committed by GitHub
parent 471b836805
commit 0ab032d47b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -12,8 +12,9 @@ function Test-ModsPath ($ModsPath, $WingetUpdatePath, $AzureBlobSASURL) {
# If path is URL # If path is URL
if ($ExternalMods -like "http*") { if ($ExternalMods -like "http*") {
# enable TLS 1.2 and TLS 1.1 protocols # ADD TLS 1.2 and TLS 1.1 to list of currently used protocols
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12, [Net.SecurityProtocolType]::Tls11 [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls11
#Get Index of $ExternalMods (or index page with href listing of all the Mods) #Get Index of $ExternalMods (or index page with href listing of all the Mods)
try { try {
$WebResponse = Invoke-WebRequest -Uri $ExternalMods -UseBasicParsing $WebResponse = Invoke-WebRequest -Uri $ExternalMods -UseBasicParsing