Use a web service with https and client certificate on WindowsForm
Posted
by Xstahef
on Stack Overflow
See other posts from Stack Overflow
or by Xstahef
Published on 2010-04-29T13:14:49Z
Indexed on
2010/04/29
13:17 UTC
Read the original article
Hit count: 460
Hi,
I need to connect to a provider's web service. He give me a certificate to access it but I have a security problem.
I have done these following steps :
- Add certificate to personal store (on IE & Firefox)
- Generate a proxy with the remote wsdl (no problem)
Use this code to call a method :
`using (service1.MessagesService m = new service1.MessagesService()) {
X509Certificate crt = new X509Certificate(@"C:\OpenSSL\bin\thecert.p12",string.Empty);
m.ClientCertificates.Add(crt);
var result = m.AuthoriseTransaction(aut);this.textBox1.AppendText(result.id.ToString());
}`
I have the following error :
The underlying connection was closed: Could not establish trust relationship for the channel SSL / TLS.
Thanks for your help
© Stack Overflow or respective owner