Ask Your Question
4

How can the issue of lacking trust relationship for the SSL/TLS secure channel while using Invoke-WebRequest in PowerShell be resolved?

asked 2021-09-15 11:00:00 +0000

woof gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-07-18 17:00:00 +0000

djk gravatar image

There are a few ways to resolve the issue of lacking trust relationship for the SSL/TLS secure channel while using Invoke-WebRequest in PowerShell:

  1. Install the root certificate of the website you are trying to connect to on the machine where the PowerShell script is running.

  2. Add the website's SSL/TLS certificate to the trusted root store on the machine where the PowerShell script is running.

  3. Disable certificate validation checks by adding the following line of code at the beginning of the PowerShell script:

[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}

However, it is important to note that disabling certificate validation checks can leave your connection vulnerable to attacks, and should be used only as a temporary solution if no other options are available. It is recommended to use one of the first two options to properly establish a trusted SSL/TLS secure channel.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-09-15 11:00:00 +0000

Seen: 10 times

Last updated: Jul 18 '21