using (var client = new HttpClient(new HttpClientHandler()));
{
// this is the line that will ignore the certificate issues.
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
var response = taskClient.GetAsync(uri).Result;
}
This blog is titled the way it is, because this is the method by which I came to learn most of the following information. 🤪
Tuesday, December 9, 2014
Call via HTTPClient to an SSL endpoint without a valid certificate
This isn't always a good idea, but sometimes you have to call an http endpoint using that has an SSL certificate that is not valid. To allow the connection and disregard the certificate error, you can do something like the following:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment