Last post Apr 09, 2013 11:22 AM by hapax_legomenon
Mar 04, 2013 12:29 PM|hapax_legomenon|LINK
I'm writing code that uses the .NET WebRequest object to send SOAP XML to an ASHX web service (an ASP.NET HTTP Handler).
I'm planning to use a Windows Service (right now it's just a console app). My app will be kicked off once an hour, and process any new data and send it off to the ASHX web service.
The owner of the ASHX web service wants me to use SSL. They have given me the security header to include in my SOAP XML, which is as follows:
<soapenv:Header> <-- Security token as part of header
They have also given me the certificate files - a few .crt files inside a zip file.
My question: What do I do with these certificate files? Is it enough just to send the SOAP header, or do I need to install the certificates on my server? Do I install them in IIS even though I'm developing a Windows Service and not a web app?
Mar 14, 2013 04:39 AM|Steven Cheng - MSFT|LINK
For connecting HTTPS/SSL secured endpoint via webrequest class, it is almost the same as HTTP one. You just need to change the url to the HTTPS specific one (see articles below):
#How to send a client certificate by using the HttpWebRequest and HttpWebResponse classes in Microsoft Visual C# .NET
#How do I use WebRequest to access an SSL encrypted site using https?
and for HTTPs server endpoint, it is possible that the server certificate cannot be verified by client-side (windows OS security layer), and it will raise an exception, we can use the event on ServicePointManager class to suppress it (see the following article):
#HttpWebRequest and Ignoring SSL Certificate Errors
And for the question you asked about "why your service provider provvide you some certficate stuffs", here are some of my understanding:
Anyway, I think you will need to confirm with the service provider on the above things. I hope that's not the #3 case I mentioned because that will make things quite complicated. While for #1 and #2, that's not difficult and is easy to achieve through the
references I mentioned.
Apr 09, 2013 11:22 AM|hapax_legomenon|LINK