How to RestSharp add client certificate in Https request? (C#)

前端 未结 1 1911
遇见更好的自我
遇见更好的自我 2020-12-28 09:01

How to RestSharp add client certificate in Https request ? My code it doesn\'t work .

    public static IRestResponse AsyncHttpRequestLogIn(strin         


        
1条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-28 10:02

    At first you should import certificate and then attach to request

    X509Certificate2 certificate = new X509Certificate2();
    certificates.Import(...);
    
    client.ClientCertificates = new X509CertificateCollection(){certificate};
    

    0 讨论(0)
提交回复
热议问题