使用 wsdl.exe 从 C# 客户端到 Tomcat 的 HTTPS 连接
我有一个 tomcat web 服务和连接到该服务的 ac# .net 客户端。我使用 wsdl.exe 创建了连接类,一切都很好。但现在我已经在tomcat中激活了ssl以使用https。在我的 C# 应用程序中,我仅将 url 更改为 https,然后收到以下错误:
底层连接已关闭:无法建立 SSL/TLS 安全通道的信任关系。
如何避免此消息?这是因为证书不受信任吗?我如何告诉我的客户此连接是可信的?
I have a tomcat webservice and a c# .net client that connects to the service. I created the Connection classes with wsdl.exe and everything is fine. But now i have activated ssl in tomcat to use https. In my c# app i only changed the url to https and i get the following error:
The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
How do i avoid this message? is this because the cretificate is untrusted? How do i tell my client that this connection is trusted?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,您的客户端很可能不信任服务器的证书。
您可以处理
ServicePointManager.ServerCertificateValidationCallback
以允许 SSL 连接到无效的证书服务器:Yes, most likely the server's certificate isn't trusted for your client.
You can handle the
ServicePointManager.ServerCertificateValidationCallback
to allow SSL connections to the invalid certificated servers: