Error while authenticating to vRA 8.x. How to eliminate Tls error ?
Invoke-RestMethod : The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
+ $response = Invoke-RestMethod -Uri $url -Method Post -Headers $header ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Please find the error screenshot
Any help would be appreciated
That seems to be ok.
Out of curiosity, did you already try with the Connect-vRAServer function from the PowervRA module?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Did you already try running the following before calling Invoke-RestMethod?
[System.Net.SecurityProtocolType]::Tls11,
[System.Net.SecurityProtocolType]::Tls12
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Yes, I am still facing the same issue.
Invoke-RestMethod : The underlying connection was closed: Could not establish trust relationship for the SSL/TLS
secure channel.
At line:1 char:2
+ Invoke-RestMethod -Uri $url -Method Post -Headers $headers -Body $bo ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc
eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
What does Get-PowerCLIConfiguration return?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Please find the output
That seems to be ok.
Out of curiosity, did you already try with the Connect-vRAServer function from the PowervRA module?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I'm getting the same error with Powervra 4.1.1
Since PowervRA is not part of PowerCLI but a community project, I suggest you open an Issue at the PowervRA repo.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference