c#调用SSL
http://xwhoyeah.iteye.com/blog/101314
- X509Store store = new X509Store(StoreName.My, StoreLocation.CurrentUser);
- store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly);
- X509Certificate2Collection certs = X509Certificate2UI.SelectFromCollection(store.Certificates, "Certificates", "Please select certificate to use", X509SelectionFlag.SingleSelection);
- HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://localhost:8443/axis/");
- request.ClientCertificates.Add(certs[0]);
- request.KeepAlive = true;
- request.Method = "POST";
- request.ContentType = "text/xml";
- request.KeepAlive = true;
- HttpWebResponse res = (HttpWebResponse)request.GetResponse();
- StreamReader sr = new StreamReader(res.GetResponseStream());
- MessageBox.Show(sr.ReadToEnd());