我必须使用带有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) . 它工作得很完美 .