Last active
August 7, 2019 16:31
-
-
Save benheise/c94558dafbfdb2d05dd089350ac0c9a2 to your computer and use it in GitHub Desktop.
nc with https in powershell
This file contains 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
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