fix(install.ps1): Enable TLS 1.2 for Windows PowerShell 5.1 compatibility
Problem
When running the default PowerShell installer command on Windows using standard Windows PowerShell 5.1:
powershell -ExecutionPolicy Bypass -c '$env:CODEX_NON_INTERACTIVE=1; irm https://chatgpt.com/codex/install.ps1 | iex'
The update/installation fails with The term 'Get-FileHash' is not recognized (or hash validation failure) because the script fails to download
the release binary package.
### Root Cause
Windows PowerShell 5.1 defaults to older SSL/TLS protocols (TLS 1.0/1.1). Without explicitly setting TLS 1.2 in install.ps1 , Invoke-RestMethod
fails to connect and fetch the release package, resulting in downstream script errors when attempting hash verification on an empty/invalid
download.
Workaround: Explicitly setting [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 resolves the issue.
### Suggested Fix
Add TLS 1.2 fallback logic near the top of install.ps1 :
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
1 Comment
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action