You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to create a Netscaler session. I received this error
Invoke-RestMethod : The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
At C:\Program Files\WindowsPowerShell\Modules\NetScaler\1.7.0\Public\Connect-NetScaler.ps1:115 char:21
Hi @bfoster68 - you will need to ensure that the certificate installed on the NetScaler admin interface is trusted by the client. In addition, the subject name on the certificate will need to match the request URL. What subject name is your certificate issued to?
Expected Behavior
Current Behavior
When trying to create a Netscaler session. I received this error
Invoke-RestMethod : The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
At C:\Program Files\WindowsPowerShell\Modules\NetScaler\1.7.0\Public\Connect-NetScaler.ps1:115 char:21
Possible Solution
This workaround works, however, I think there are security implications to this but it allowed me to get past the issue.
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}
}
"@
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy
Steps to Reproduce (for bugs)
Use Netscaler generated cert or Self signed cert.
$SecurePassword = ConvertTo-SecureString $Password -AsPlainText -Force
$Credential = New-Object System.Management.Automation.PSCredential ($Username,
$SecurePassword)
$Session = Connect-Netscaler -Hostname $Nsip -Credential $Credential -https -PassThru
Context
Your Environment
The text was updated successfully, but these errors were encountered: