How to change the following code to using x509 certs in a cert store the local machine?

J

jens Jensen

HttpWebRequest req =
(HttpWebRequest)HttpWebRequest.Create(ConfigurationManager.AppSettings["URI"]);

req.Proxy = new
System.Net.WebProxy(ConfigurationManager.AppSettings["ProxyString"], true);

req.ContentType = "application/x-www-form-urlencoded";

req.Method = "POST";

byte[] bytes = System.Text.Encoding.ASCII.GetBytes(param);

req.ContentLength = bytes.Length;

System.Net.WebResponse resp = req.GetResponse();

if (req == null) return null;

System.IO.StreamReader sr = new
System.IO.StreamReader(resp.GetResponseStream());

return sr.ReadToEnd().Trim();





I need to secure the communication with ssl. How can this be done?

I have the certs in the local store?



Many thanks in advance

JJ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top