my iwr is getting error

Davi Ramon 0 Reputation points

my iwr is getting error here is im getting

iwr : The request was aborted: Unable to create a secure channel for SSL/TLS.
On line: 1 character: 2
+ iwr -useb | iex
+ ~~~~~~~~~~~~~~~~~~~~~~
     + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
     + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,145 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 44,101 Reputation points


    Thank you for your question and reaching out.

    The error's may cause due to Powershell connects to websites by default using TLS 1.0, while TLS 1.2 is required for website security. Running any of the commands listed below will cause this behaviour to alter to utilise all protocols. Additionally, you can specify a single protocol.

    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls, [Net.SecurityProtocolType]::Tls11, [Net.SecurityProtocolType]::Tls12, [Net.SecurityProtocolType]::Ssl3

    [Net.ServicePointManager]::SecurityProtocol = "Tls, Tls11, Tls12, Ssl3"

    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments