我遇到了这样一种情况:我需要用X509证书签署soap请求,以供java web服务使用。通过WCF的魔力,我们能够正确地形成信封,并且所有的信封看起来都比标准的http更好。但是,一旦我们转移到HTTPS (客户端要求),我们就开始收到错误消息“无法与授权机构建立SSL/TLS安全通道的信任关系”。我们已经尝试调整一些设置并将目标域更改为其他已知的HTTPS站点,但仍然收到相同的错误。下面是我们的客户端配置,非常感谢!
<?xml version="1.0"?>
<configuration>
<system.serviceModel>
<bindings>
<customBinding>
<binding
name="myCustomBinding"
closeTimeout="00:01:00"
openTimeout="00:01:00"
receiveTimeout="00:10:00"
sendTimeout="00:01:00">
<textMessageEncoding
messageVersion="Soap11" />
<security
allowInsecureTransport="true"
authenticationMode="MutualCertificate"
requireDerivedKeys="false"
keyEntropyMode="ClientEntropy"
includeTimestamp="false"
securityHeaderLayout="Lax"
messageProtectionOrder="SignBeforeEncrypt"
messageSecurityVersion="WSSecurity10WSTrust13WSSecureConversation13WSSecurityPolicy12BasicSecurityProfile10">
<secureConversationBootstrap />
</security>
<httpsTransport />
</binding>
</customBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="wsHttpCertificateBehavior">
<clientCredentials>
<clientCertificate
findValue="MyCertName"
storeLocation="LocalMachine"
x509FindType="FindByIssuerName"/>
<serviceCertificate>
<authentication
revocationMode="NoCheck"
trustedStoreLocation="LocalMachine" />
</serviceCertificate>
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>
<client>
<endpoint
address="https://www.SomeUrl.com"
binding="customBinding"
bindingConfiguration="myCustomBinding"
behaviorConfiguration="wsHttpCertificateBehavior"
contract="ServiceReference1.ServiceTest"
name="untk48_dfSoap">
<identity>
<certificateReference findValue="MyCertName" storeLocation="LocalMachine" x509FindType="FindByIssuerName"/>
</identity>
</endpoint>
</client>
</system.serviceModel>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>发布于 2013-08-28 15:12:13
您的证书友好名称是否与https的域名匹配?
我必须在过去让HTTPS WCF正确验证
e.g
友好名称box1.mycompany.au.net
发布于 2013-10-01 17:01:08
在客户机上安装证书,就不会出现这个问题。安装时,请确保将其安装到中间证书颁发机构和受信任的根证书颁发机构。
对我很管用。
https://stackoverflow.com/questions/13272756
复制相似问题