February 2019
Intermediate to advanced
626 pages
15h 51m
English
If a connection to a web service uses HTTPS (HTTP over Secure Sockets Layer (SSL)), the certificate must be validated before a connection can complete and a request can be completed. If a web service has an invalid certificate, an error will be returned.
How PowerShell reacts to different scenarios can be tested. The badssl site can be used to test how PowerShell might react to different SSL scenarios: https://badssl.com/.
For example, when attempting to connect to a site with an expired certificate (using Invoke-WebRequest), the following message will be displayed in Windows PowerShell:
PS> Invoke-WebRequest https://expired.badssl.com/ Invoke-WebRequest : The underlying connection was closed: Could not establish trust relationship ...
Read now
Unlock full access