我有一种情况,我需要使用 X509 证书签署一个肥皂请求以供 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>