Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello

 

I've built a windows test client for a web service I have, and I'm trying to attach a certificate to the request from the test client to the web service. This works fine in when in release mode, but the certificate does not seem to be attached when in debug mode. Can anybody figure out why this is?

 

Here's the code where I attach the certificate:

 

(WS is the web service)

 

WS.ClientCertificates.Clear();

X509Certificate certificate = X509Certificate.CreateCertFromFile( @"C:\cert.cer" );

ServicePointManager.CertificatePolicy = new ServerCertificatePolicy();

WS.ClientCertificates.Add( certificate );

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...