I am trying to access Foreman API in Powershell version 5.1 using Invoke-RestMethod
I get following error:
Invoke-RestMethod : The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
I tried following command before the this command but it didn't work.
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
I tried with Tls, Tls11 also but it didn't work.