POWERSHELL vs TLS

Problem

Hello World,

I guess many of you are familiar with TLS right?

And about the version that PowerShell is using in simple commands like Invoke-RestMethod or Invoke-WebRequest?

Did you know that its TLS 1.0 as default? if not then probably you got this error message: 

 

Solution

Simple, just use the next statement in your script:

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls -bor [Net.SecurityProtocolType]::Tls11 -bor [Net.SecurityProtocolType]::Tls12

this will do the work for TLS 1.2/1.1/1.0

That’s it, Thanks

Add a Comment

Your email address will not be published. Required fields are marked *