In a windows store app I am trying to connect to a api using this code
try {
using(var httpClient = new HttpClient {
BaseAddress = Constants.baseAddress
}) {
using(var content = new StringContent(DataToSend, System.Text.Encoding.UTF8, "application/json")) {
using(var response = await httpClient.PostAsync("oauth2/token", content)) {...
}...
}
}
} catch (Exception e) {...
}
but I am getting this exception:
The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
and in the InnerException
The remote certificate is invalid according to the validation procedure.
I've been told I need to trust unknown certificates. How can I do that on windows store app ?