Developer technologies | Universal Windows Platform (UWP)
A Microsoft platform for building and publishing apps for Windows devices.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I want to perform ssl pinning on my UWP app. My app runs on Visual Studio 2015 update 3. I need to validate server certificates agains our root CA. I am not able to get reference of System.Security.Cryptography.X509Certificates but not available. Please let me know the alternatives here.
I have tried the below:
//filter.ClientCertificate = await this.getClientCertiifcate(posCertificateString, password);
var httpClient = new Windows.Web.Http.HttpClient(filter);
var httpContent = new Windows.Web.Http.HttpStringContent(requestObj, Windows.Storage.Streams.UnicodeEncoding.Utf8);
httpContent.Headers.ContentType = Windows.Web.Http.Headers.HttpMediaTypeHeaderValue.Parse("application/x-www-form-urlencoded");
var response = await httpClient.PostAsync(new Uri(URL), httpContent);
string content = await response.Content.ReadAsStringAsync();
JsonObject statusObject = new JsonObject();
statusObject.Add("response", JsonValue.CreateStringValue(content));
return content;
Please find my code here:
private void FilterOnServerCustomValidationRequested(HttpBaseProtocolFilter sender, HttpServerCustomValidationRequestedEventArgs args)
{
try
{
byte[] bytes = System.Convert.FromBase64String(this.rootCertificate); // Our root CA. Need to validate against args.ServerCertificate
}
catch(Exception e)
{
args.Reject();
}
}
A Microsoft platform for building and publishing apps for Windows devices.