作者:qiao203 | 来源:互联网 | 2023-10-10 14:03
ThismaybeastupidquestionbutIjustcantfindtheanswer.这可能是一个愚蠢的问题,但我找不到答案。WhatIwouldl
This may be a stupid question but I just can't find the answer.
这可能是一个愚蠢的问题,但我找不到答案。
What I would like to do: I have a WCF service hosted by IIS. It is working perfectly, I can access the wsdl, I have a self-signed certificate for the server etc. I would like to call this service from a WPF client.
我想做什么:我有一个由IIS托管的WCF服务。它工作得很好,我可以访问wsdl,我有一个服务器的自签名证书等。我想从WPF客户端调用此服务。
The problem is, since I have a self-signed certificate, I get the following exception when calling the service: Could not establish trust relationship for the SSL/TLS secure channel with authority 'localhost'.
问题是,由于我有自签名证书,因此在调用服务时出现以下异常:无法为具有权限“localhost”的SSL / TLS安全通道建立信任关系。
If I access the site (or the service) from a browser, it is no problem, because the browser warns me about the certificate, and gives me the choice of viewing the page anyway. But the WPF client just throws an exception.
如果我从浏览器访问该站点(或服务),则没有问题,因为浏览器会向我发出关于证书的警告,并且让我可以选择查看该页面。但WPF客户端只是抛出异常。
I don't want to completely turn off the authentication process, I simply would like to give the users the option of ignoring this warning (as browsers do).
我不想完全关闭身份验证过程,我只是想让用户选择忽略此警告(就像浏览器那样)。
Can anyone provide some code for this? If you ran into a good, detailed tutorial about this, it would be awesome too. (See, my problem with the tutorials I've found is the lack of details)
任何人都可以为此提供一些代码吗?如果你遇到一个关于这个的好的,详细的教程,它也会很棒。 (看,我发现的教程问题是缺乏细节)
2 个解决方案