Enforce usage of TLS 1.2 when building Chocolatey package #5422
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Currently, the Chocolatey build is failing: #5416
Github appears to have started enforcing TLS 1.2 at some point: https://www.ssllabs.com/ssltest/analyze.html?d=github.com
![](https://camo.githubusercontent.com/c65d7d5f38e084d27a2a4ff219b72d68ca07c0ed574d9950c6c2553a5d90e144/68747470733a2f2f642e73622f323031382f30322f66697265666f785f32372d31332e35312e35392e706e67)
However, PowerShell uses TLS 1.0 by default. This causes an error when loading from GitHub via
Invoke-WebRequest
:We need to enforce TLS 1.2 to make it work:
Test plan
Downloading Yarn installer via Invoke-WebRequest was failing:
Now it works!