[powershell]Unable to establish tls session

If you encounter a code that throws an error saying unable to establish tls session with the target server, most likely tls version is lesser than version 1.2 and your server only accepts 1.2

#To ensure the powershell use tls version 1.2.
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s