Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling SSL Web Service

Status
Not open for further replies.

MadJock

Programmer
May 25, 2001
318
GB
Hi All,

I need to call a web service where the server requires us to authenticate with a certificate.

The following code works as long as the certificate is installed in the Windows certificate store:

Code:
            MyTestService service = new MyTestService();
            service.Url = targetEndPoint;
            service.Proxy = new WebProxy("[URL unfurl="true"]http://my.proxy.com");[/URL]
            
            service.ClientCertificates.Add(new X509Certificate(@"c:\cert\mycert.p12", "pwd"));

            service.WebMethod()

However, I don't quite understand why the certificate must be installed in the certifocate store given that I am providing the file location and password.

Due to the vast amount of info on calling web services I'm struggling with Google, but one old article suggested that perhaps .Net is only extracting the public key from the certificate file.

This is more a curiosity than an issue, but would appreciate any explanation!

Thanks,

Graeme

"Just beacuse you're paranoid, don't mean they're not after you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top