繁体   English   中英

在Azure Web角色中为WCF终结点添加其他SSL行为

[英]Add additional SSL behavior for WCF endpoint within Azure Web Role

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

因此有效的端点是: 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>

非常感谢你

通过以下步骤解决:

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM