Well, I could not find any articles with end to end solution so I had to move forward with my own research/trial-error method.
To try out, I bought the FREE SSL certificate for my domain (www.mydomain.com).
Note: Free SSL Certificate for 90 Days is available from COMODO website (click here[^]). Their support team is great and help you troubleshoot any issues for installation etc. You will also need to contact your hosting provider to generate CSR (Certificate Signing Request) and provide to you. You can take the CSR to comodo website and submit an order for cert. Your cert will be emailed to you soon.
So, I installed the certificate on my site by contacting support team of my hosting provider. I tested my site and see the locked icon and certificate information. So far so good.
Now, I wanted to use client certificate file (mydomain.cer) to call web service hosted on my website which will be called from windows client. I added following code.
string certPath = "C:\\MyProjects\\WinApp1\\mydomain.cer";
X509Certificate cert = X509Certificate.CreateFromCertFile(certPath);
While debugging, I found the following error on 2nd line.
CryptographicException: "The index value is not valid."
I could not find anything specific about below error on google too :( so I contacted Comodo support team. They sent me another file with extension .CRT instead of .CER.
So, I applied following changes to the code and it worked.
string certPath = "C:\\MyProjects\\WinApp1\\mydomain.CRT";
X509Certificate cert = X509Certificate.CreateFromCertFile(certPath);
Next, I added code to add certificate and call the web service method.
service.ClientCertificates.Add(cert);
string resultString = service.ServiceMethod(param1);
However, I got the following error this time.
System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction:
So, I found that I had to update the web service reference in my winforms application may be bcoz the website now contains SSL certificate and changes etc.
Right Click on Web Reference and click on "Update Web Reference".
After applying changes, I was able to call web service using Client Certificate, using below code.
string certPath = "C:\\MyProjects\\WinApp1\\mydomain.CRT";
X509Certificate cert = X509Certificate.CreateFromCertFile(certPath);
service.ClientCertificates.Add(cert);
string resultString = service.ServiceMethod(param1);
Hope it helps someone.