I am trying to read some data from a local https server using HttpClient. The code works OK for HTTP. The Exception which is thrown with HTTPS is
System.Net.WebException : Send Failure. Error Writing Headers
var client = new System.Net.Http.HttpClient();
client.BaseAddress = new Uri("https://192.168.12.15/");
var response = await client.GetAsync("json.php");
var retdata = response.Content.ReadAsStringAsync ().Result;
I don't want to jump the gun here, but I happen to know that the certificate offered by the web server may fail validity checks because it has been self signed. If it is related to this is it possible to add a callback to allow prevent the certificate being rejected. When I try to access the URL from Safari the page is served, but only after I have accepted certificate warnings.
However.....the problem may not even be related to the certificate, can anyone comment?
Thanks.