Using ClientCertificates in PCL

Hi all,
I am developing an application that needs to communicate with the server via https.
I would like put this logic in PCL. But I faced with problem: HttpWebRequest in PCL does not have ClientCertificates property.
How can I set ClientCertificates to HttpWebRequest in PCL.
Thanks

Posts

  • PeterDavisPeterDavis USMember ✭✭✭

    I don't think you can do ClientCertificates in the PCL. What you might consider doing is creating a wrapper (using an interface) for HttpWebRequest and implement that in your clients. You can then pass it into the PCL to use. Does that make sense? You'd create an interface called IMyHttpWebRequest and add the minimal functionality you need to wrap HttpWebRequest. You might also need to wrap the certificates themselves. Then you just pass the objects to the PCL by way of their interfaces and the PCL can interoperate with them.

    The implementation would be similar to the Logging example I describe here

Sign In or Register to comment.