简体   繁体   中英

C# application could not establish trust relationship for the SSL/TLS secure channel

I have a windows application (C#) in local machine. When I add a web service as service reference I get this alert:

警报

I clicked Yes button in this window. So web service installed in my application like this:

安装

Then I invoked this web service to form1.But I get this error:

错误

I tested this . But isn't work fine. I read many another posts for solve this problem but they didn't work properly.

It would be very helpful if someone could explain solution for this problem.

i suggest that use code below before call methods of web service:

ServicePointManager.ServerCertificateValidationCallback = delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; };

But you may get 'Access is denied' error instead of the last when calling the functions and methods. this event occures because of security level of server that you reference on it when you call functions. so to resolve that you have to call and get services from support team of mentioned server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM