【问题标题】:Add additional SSL behavior for WCF endpoint within Azure Web Role在 Azure Web 角色中为 WCF 端点添加额外的 SSL 行为
【发布时间】:2014-03-13 18:54:11
【问题描述】:

我们的 azure Web 应用程序已经将 https 端口 443 与我们的站点证书一起使用,我们在此 webrole 中有一个 WCF 服务,该服务有一个使用我们的证书进行身份验证的 https 端点(单向 ssl),同样的服务需要一个额外的 https 端点使用我们的证书和第三方的证书支持 2-way auth。我们已经上传了证书,更新了服务定义文件,并添加了一个我们希望能够工作的端点,但在测试中我们得到了错误:服务“SslRequireCert”的 SSL 设置与 IIS 的“无”不匹配'。

所以有效的端点是:https://environemnt.application.com/Services/Service.svc 产生错误的端点:https://environment.application.com/Services/Service.svc/twa

关键要求是https,端口443,在上面的新端点,不改变角色其余部分的SSL行为,我看到条目改变IIS配置或使用角色编辑器添加一个Https Input 端点,但由于我们已经在端口 443 上使用我们的站点证书有一个 Https Input 端点,我不想改变/影响整个角色。

如果有帮助,该服务是 WCF 服务,它使用 Mtom 编码的 soap 1.2 消息

这是我们输入的新值,我还需要什么?

<behaviors>
 <serviceBehaviors>
   <behavior name="SSLServiceBehavior">
     <serviceMetadata httpsGetEnabled="true" />
     <serviceDebug includeExceptionDetailInFaults="true" />
     <dataContractSerializer maxItemsInObjectGraph="2147483647" />
   </behavior>
 </serviceBehaviors>
 <endpointBehaviors>
  <behavior name="OneWayAuthEndpointBehavior">
  </behavior>
  <behavior name="TwoWayAuthEndpointBehavior">
      <endpointDiscovery enabled="true"></endpointDiscovery>
      <clientCredentials>
        <clientCertificate findValue="thumprint..." storeLocation="LocalMachine" storeName="CertificateAuthority" x509FindType="FindByThumbprint"  />
      </clientCredentials>
    </behavior>
 </endpointBehaviors>
</behaviors>
<services>
 <service behaviorConfiguration="SSLServiceBehavior" name="Service">
  <endpoint address="" behaviorConfiguration="OneWayAuthEndpointBehavior"binding="wsHttpBinding" bindingConfiguration="HttpsMtomOneWay" contract="ITestService" />
  <endpoint address="twa" behaviorConfiguration="TwoWayAuthEndpointBehavior" binding="wsHttpBinding" bindingConfiguration="HttpsMtomTwoWay" contract="ITestService"/>
</services>
<bindings>
 <wsHttpBinding>
  <binding name="HttpsMtomOneWay" messageEncoding="Mtom">
    <security mode="Transport">
      <transport clientCredentialType="None" />
    </security>
  </binding>
  <binding name="HttpsMtomTwoWay" messageEncoding="Mtom">
    <security mode="Transport">
      <transport clientCredentialType="Certificate" />
    </security>
  </binding>
 </wsHttpBinding>
</bindings>

非常感谢

【问题讨论】:

    标签: c# web-services wcf azure ssl


    【解决方案1】:

    通过以下步骤修复:

    • 向服务行为添加了 serviceCredentials.serviceCertificate(我们证书的证书详细信息)
    • 消除了端点行为定义
    • 将 HttpsMtomTwoWay 绑定更改为 securityMode=Message

    现在消息处理程序处理身份验证交换和外部证书验证,然后传递到传输端点,我们不需要弄乱站点范围的 SSL 或端点设置。经过众多第三方的测试和验证。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-01-09
      • 2011-05-26
      • 2017-11-30
      • 2015-11-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多