Trusting Self-Signed HTTPS Certificates

PHOTO EMBED

Sat Mar 13 2021 11:38:25 GMT+0000 (UTC)

Saved by @philip #powershell #certificate

class TrustAll : System.Net.ICertificatePolicy 
{
  [bool]CheckValidationResult([System.Net.ServicePoint]$sp, [System.Security.Cryptography.X509Certificates.X509Certificate]$cert, [System.Net.WebRequest]$request, [int]$problem)
  {
    return $true
  }
}

[System.Net.ServicePointManager]::CertificatePolicy = [TrustAll]::new()
content_copyCOPY