Created
August 15, 2016 05:19
-
-
Save badcommandorfilename/d8523a47ec07ce187761f69d325b3ce5 to your computer and use it in GitHub Desktop.
.Net Core ignore ssl/X509 self-signed http request
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
using (var handler = new HttpClientHandler()){ | |
handler.ServerCertificateCustomValidationCallback = delegate { return true; }; | |
using (var httpClient = new HttpClient(handler)){ | |
return httpClient.GetStringAsync("http://" + self.URL + "/version").Result; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment