首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >基于HTTPS的WCF customBinding

问基于HTTPS的WCF customBinding
EN

Stack Overflow用户
提问于 2012-11-07 23:26:12
回答 2查看 1.3K关注 0票数 0

我遇到了这样一种情况:我需要用X509证书签署soap请求,以供java web服务使用。通过WCF的魔力,我们能够正确地形成信封,并且所有的信封看起来都比标准的http更好。但是,一旦我们转移到HTTPS (客户端要求),我们就开始收到错误消息“无法与授权机构建立SSL/TLS安全通道的信任关系”。我们已经尝试调整一些设置并将目标域更改为其他已知的HTTPS站点,但仍然收到相同的错误。下面是我们的客户端配置,非常感谢!

代码语言:javascript
复制
<?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>
EN

回答 2

Stack Overflow用户

发布于 2013-08-28 15:12:13

您的证书友好名称是否与https的域名匹配?

我必须在过去让HTTPS WCF正确验证

e.g

友好名称box1.mycompany.au.net

请求https://box1.mycompany.au.net的域

票数 0
EN

Stack Overflow用户

发布于 2013-10-01 17:01:08

在客户机上安装证书,就不会出现这个问题。安装时,请确保将其安装到中间证书颁发机构和受信任的根证书颁发机构。

对我很管用。

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13272756

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档