TLS 1.2 in PowerShell¶
By default, PowerShell will use SSL3.0 and TLS1.0. This can prove problematic when performing web requests to sites that have disabled these insecure protocols, and you may see an error such as:
In order to allow a connection to be established, we can force PowerShell to use a more secure protocol, like TLS 1.2, using this command:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
You can use this command to see what protocols will be used:
[Net.ServicePointManager]::SecurityProtocol
Voila! You can now establish a connection to the site over a secure protocol.
Note
This will only change this for the current session. If you want this change to be persistent, you’ll need to apply this change in your PowerShell profile