Skip to content

Instantly share code, notes, and snippets.

@moddingg33k
Created August 7, 2020 07:06
Show Gist options
  • Save moddingg33k/11f24eaaa379dfb08c56d28e802e734c to your computer and use it in GitHub Desktop.
Save moddingg33k/11f24eaaa379dfb08c56d28e802e734c to your computer and use it in GitHub Desktop.
#requires -Version 5
#requires -PSEdition Desktop
class TrustAllCertsPolicy : System.Net.ICertificatePolicy {
[bool] CheckValidationResult([System.Net.ServicePoint] $a,
[System.Security.Cryptography.X509Certificates.X509Certificate] $b,
[System.Net.WebRequest] $c,
[int] $d) {
return $true
}
}
[System.Net.ServicePointManager]::CertificatePolicy = [TrustAllCertsPolicy]::new()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment