Infoblox-Classy
Infoblox-Classy copied to clipboard
Add support for SkipSslValidation
By default Infoblox has a self signed certificate. There is no way to use the powershell cmdlets with this untrusted certificate.
Test-IBGridmaster : Unable to connect to Infoblox device gm.local. Error code: System.Net.WebException: The underlying connection was close d: Could not establish trust relationship for the SSL/TLS secure channel. ---> System.Security.Authentication.AuthenticationException: The remote ce rtificate is invalid according to the validation procedure.
at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(WebRequest request)
at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord()
At line:1 char:1
+ Test-IBGridmaster -Gridmaster gm.local
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Test-IBGridmaster
Maybe this is an option? https://www.briantist.com/errors/could-not-establish-trust-relationship-for-the-ssltls-secure-channel/
or this
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
yeah I actually use that bottom snippet in the pester tests. First thought, I could possibly add a "-IgnoreCerts" parameter to both test-ibgridmaster and new-ibwebsession. I think that should carry over to all the other functions. I'll do some testing and see how that works.