mirror of
https://github.com/benclaussen/NetboxPS.git
synced 2025-12-13 18:02:29 +00:00
Add Set-NetboxUnstrustedSSL for disable SSL chain test (for PS 5.0
From PowerAruba/FortiPwoer Module :)
This commit is contained in:
parent
c8c6d48ee4
commit
c8233ab572
1 changed files with 19 additions and 0 deletions
19
Functions/Setup/Set-NetboxUnstrustedSSL.ps1
Normal file
19
Functions/Setup/Set-NetboxUnstrustedSSL.ps1
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
Function Set-NetboxUntrustedSSL {
|
||||||
|
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessforStateChangingFunctions", "")]
|
||||||
|
Param( )
|
||||||
|
# Hack for allowing untrusted SSL certs with https connections
|
||||||
|
Add-Type -TypeDefinition @"
|
||||||
|
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 -TypeName TrustAllCertsPolicy
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue