Created
July 20, 2021 19:07
-
-
Save IAmStoxe/6f4580350f9ba3c8320a22ae1ab7e549 to your computer and use it in GitHub Desktop.
Ignore Invalid SSL Certificates In PowerShell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# Ignore SSL Cert Hack #> | |
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 | |
<# End Hack #> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment