我必须使用带有SSL证书和服务器证书的java webservice . 我获得了TLS证书和WSS证书
我的app.config:
binding="customBinding" bindingConfiguration="customB" behaviorConfiguration="myBehavior" contract="ServiceReference1.MyClient" name="Name" >
messageSecurityVersion="WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10" >
在应用程序代码中我添加:
ServicePointManager.ServerCertificateValidationCallback += delegate { return true; };
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
而且我一直都有错误: Could not establish secure channel for SSL/TLS with authority ADDR
我也尝试过:
client.ClientCredentials.ClientCertificate.Certificate = store.Certificates.Find(X509FindType.FindByThumbprint, "THUMB", false)[0];
其中THUMB是TLS或WSS证书(检查两者)
我还尝试在接口之前添加Reference.cs:
ProtectionLevel = ProtectionLevel.Sign
仍然没有运气 . 你能给我任何建议吗?我在Soap UI中有工作项目,在选项中我选择了SSL证书,在传出WS-Security配置中添加了带有二进制安全令牌选项的Siganture证书(WSS) . 它工作得很完美 .
博主在尝试使用Java WebService时遇到SSL连接问题,已尝试多种SSL/TLS证书配置,包括WSS和TLS,以及客户端证书验证。寻求帮助,如何正确设置ServerCertificateValidationCallback、SecurityProtocol和引用证书。读者可能面临相似挑战,本文提供故障排查和解决方案建议。
2644

被折叠的 条评论
为什么被折叠?



