From e85ce8cfa165736cc021bcb0be4b33041fd4436c Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Fri, 3 Apr 2026 05:21:06 -0400 Subject: [PATCH 1/2] tls fix --- run.ps1 | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/run.ps1 b/run.ps1 index 5634c37..a73a7c8 100644 --- a/run.ps1 +++ b/run.ps1 @@ -9,6 +9,11 @@ param ( $ErrorActionPreference = "Stop" +# Ensure TLS 1.2/1.3 on older .NET / Windows PowerShell +[Net.ServicePointManager]::SecurityProtocol = ` + [Net.SecurityProtocolType]::Tls12 -bor ` + [Net.SecurityProtocolType]::Tls13 + $versions = @{ "7.0" = "vc14" "7.1" = "vc14" @@ -53,7 +58,7 @@ if (-not (Test-Path "php-sdk")) { $temp = New-TemporaryFile | Rename-Item -NewName {$_.Name + ".zip"} -PassThru $url = "https://github.com/php/php-sdk-binary-tools/releases/download/php-sdk-2.3.0/php-sdk-binary-tools-php-sdk-2.3.0.zip" - Invoke-WebRequest $url -OutFile $temp + Invoke-WebRequest $url -OutFile $temp -UseBasicParsing Expand-Archive $temp -DestinationPath "." Rename-Item "php-sdk-binary-tools-php-sdk-2.3.0" "php-sdk" } @@ -67,7 +72,7 @@ if (-not (Test-path "php-bin")) { $fname = "php-$revision-$tspart-$vs-$arch.zip" $url = "$baseurl/$fname" Write-Output "Downloading $url ..." - Invoke-WebRequest $url -OutFile $temp + Invoke-WebRequest $url -OutFile $temp -UseBasicParsing Expand-Archive $temp "php-bin" } @@ -78,14 +83,14 @@ if (-not (Test-Path "php-dev")) { $fname = "php-devel-pack-$revision-$tspart-$vs-$arch.zip" $url = "$baseurl/$fname" Write-Output "Downloading $url ..." - Invoke-WebRequest $url -OutFile $temp + Invoke-WebRequest $url -OutFile $temp -UseBasicParsing Expand-Archive $temp "." Rename-Item "php-$revision-devel-$vs-$arch" "php-dev" } if ($deps.Count -gt 0) { $baseurl = "https://downloads.php.net/~windows/php-sdk/deps" - $series = Invoke-WebRequest "$baseurl/series/packages-$version-$vs-$arch-staging.txt" + $series = Invoke-WebRequest "$baseurl/series/packages-$version-$vs-$arch-staging.txt" -UseBasicParsing $remainder = @() $installed = $false foreach ($dep in $deps) { @@ -95,7 +100,7 @@ if ($deps.Count -gt 0) { $temp = New-TemporaryFile | Rename-Item -NewName {$_.Name + ".zip"} -PassThru $url = "$baseurl/$vs/$arch/$line" Write-Output "Downloading $url ..." - Invoke-WebRequest $url -OutFile $temp + Invoke-WebRequest $url -OutFile $temp -UseBasicParsing Expand-Archive $temp "../deps" $installed = $true break From c391923f79202e73f64b8cb15844fee60cbc6c94 Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Fri, 3 Apr 2026 05:37:57 -0400 Subject: [PATCH 2/2] Defensive fix - make sure we have Tls13 --- determine-revision.ps1 | 8 +++++--- run.ps1 | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/determine-revision.ps1 b/determine-revision.ps1 index 7f26237..907a31a 100644 --- a/determine-revision.ps1 +++ b/determine-revision.ps1 @@ -5,9 +5,11 @@ param ( $ErrorActionPreference = "Stop" # Ensure TLS 1.2/1.3 on older .NET / Windows PowerShell -[Net.ServicePointManager]::SecurityProtocol = ` - [Net.SecurityProtocolType]::Tls12 -bor ` - [Net.SecurityProtocolType]::Tls13 +$securityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 +if ([Enum]::GetNames([Net.SecurityProtocolType]) -contains "Tls13") { + $securityProtocol = $securityProtocol -bor [Net.SecurityProtocolType]::Tls13 +} +[Net.ServicePointManager]::SecurityProtocol = $securityProtocol function Get-ReleasesJson([string] $url) { return Invoke-RestMethod -Uri $url -UseBasicParsing diff --git a/run.ps1 b/run.ps1 index a73a7c8..7131f52 100644 --- a/run.ps1 +++ b/run.ps1 @@ -10,9 +10,11 @@ param ( $ErrorActionPreference = "Stop" # Ensure TLS 1.2/1.3 on older .NET / Windows PowerShell -[Net.ServicePointManager]::SecurityProtocol = ` - [Net.SecurityProtocolType]::Tls12 -bor ` - [Net.SecurityProtocolType]::Tls13 +$securityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 +if ([Enum]::GetNames([Net.SecurityProtocolType]) -contains "Tls13") { + $securityProtocol = $securityProtocol -bor [Net.SecurityProtocolType]::Tls13 +} +[Net.ServicePointManager]::SecurityProtocol = $securityProtocol $versions = @{ "7.0" = "vc14"