|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Consuming Webservice via httpsHi and sorry for the heavy crossposting (fu2 mpdf)!
As you might have gotten out of the subject line, my application tries to consume a webservice that's being connected to via https. This works fine when I use a windows forms app. Trying the same from within an asp.net app fails. As far as I can tell this is due to the lack of an installed client certificate for the ASPNET windows user account. The certificate I use is available as X.509 (.cer) and as PKCS #7 (.p7b). On MSDN I read an article that tells how to install an PKCS #12 certificate (.pfx) into the machines certificate store. My question is now: How can I connect to the webservice using the certificate I got? Any answer is appreciated. Regards! You can use something like this:
// Load the client certificate from a file. X509Certificate x509 = X509Certificate.CreateFromCertFile(@"c:\user.cer"); // Add the client certificate to the ClientCertificates property of the proxy class. webservice.ClientCertificates.Add(x509); Regards, Catalin Show quote "Jens Mander" wrote: > Hi and sorry for the heavy crossposting (fu2 mpdf)! > > As you might have gotten out of the subject line, my application tries to > consume a webservice that's being connected to via https. This works fine > when I use a windows forms app. Trying the same from within an asp.net app > fails. As far as I can tell this is due to the lack of an installed client > certificate for the ASPNET windows user account. The certificate I use is > available as X.509 (.cer) and as PKCS #7 (.p7b). On MSDN I read an article > that tells how to install an PKCS #12 certificate (.pfx) into the machines > certificate store. > > My question is now: How can I connect to the webservice using the > certificate I got? > > Any answer is appreciated. > > Regards! > > > |
|||||||||||||||||||||||