Skip to content

Instantly share code, notes, and snippets.

@benheise
Last active August 7, 2019 16:31
Show Gist options
  • Save benheise/c94558dafbfdb2d05dd089350ac0c9a2 to your computer and use it in GitHub Desktop.
Save benheise/c94558dafbfdb2d05dd089350ac0c9a2 to your computer and use it in GitHub Desktop.
nc with https in powershell
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;
}
}
"@
$AllProtocols = [System.Net.SecurityProtocolType]'Ssl3,Tls,Tls11,Tls12'
[System.Net.ServicePointManager]::SecurityProtocol = $AllProtocols
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy
$r = iwr https://benjaminheise.com -Method 'OPTIONS' -UseBasicParsing
$r.Headers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment