Powershell Invoke-WebRequest Fails with SSL/TLS Secure Channel

hewstone picture hewstone · Jan 12, 2017 · Viewed 180.3k times · Source

I'm trying to execute this powershell command

Invoke-WebRequest -Uri https://apod.nasa.gov/apod/

and I get this error. "Invoke-WebRequest : The request was aborted: Could not create SSL/TLS secure channel." https requests appear to work ("https://google.com") but not this one in question. How can I get this to work or use other powershell command to read the page contents?

Answer

Chandan Rai picture Chandan Rai · Jan 12, 2017

try using this one

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest -Uri https://apod.nasa.gov/apod/