lundi 9 octobre 2017

Connect to web API with certificate

I want to connect to third party API from my web application. They have given me a certificate file(.p12) and two .pem files.One with certificate information and one with private key.

The issue is when i try to connect to the API, it gives me an error saying 'Signature and/or certificate invalid'. This is how I added the certificate to my http request.

        HttpWebRequest request = new HttpWebRequest();
        X509Certificate cert = new X509Certificate("<location>","<password>");
        request.ClientCertificates.Add(cert);

I want to know what is missing in here. And is there any other way to add certificate to web request.

Thanks in advance




Aucun commentaire:

Enregistrer un commentaire