简体   繁体   English

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

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

Our azure web application already uses https port 443 with our site certificate, we have a WCF service within this webrole that has an https endpoint using our cert to authenticate (1-way ssl), this same service needs an additional https endpoint supporting 2-way auth using our cert and the third party's cert. 我们的azure Web应用程序已经使用带有站点证书的https端口443,在此webrole中有一个WCF服务,该服务具有一个使用我们的证书进行身份验证的https端点(1-way ssl),该服务需要一个额外的https端点,支持2-使用我们的证书和第三方证书进行方式验证。 We have uploaded the cert, updated the service definition file, and added an endpoint that we are hoping will work, but in testing we are getting the error: The SSL settings for the service 'SslRequireCert' does not match those of the IIS 'None'. 我们已经上传了证书,更新了服务定义文件,并添加了我们希望能够工作的端点,但是在测试中我们遇到了错误:服务“ SslRequireCert”的SSL设置与IIS“无”的SSL设置不匹配'。

so the endpoint that does work is: https://environemnt.application.com/Services/Service.svc the endpoint that generates the error: https://environment.application.com/Services/Service.svc/twa 因此有效的端点是: https : //environemnt.application.com/Services/Service.svc生成错误的端点: https : //environment.application.com/Services/Service.svc/twa

The key requirement is that it is https, port 443, at the above new endpoint, without altering the SSL behavior of the rest of the role, I have seen entries to change the IIS configuration or use the role editor to add an Https Input endpoint, but as we already have an Https Input endpoint on port 443 using our site cert I don't want to alter/affect the whole role. 关键要求是在上述新端点上是https端口443,而没有更改其余角色的SSL行为,我已经看到了一些条目来更改IIS配置或使用角色编辑器添加Https Input端点,但是由于我们已经使用站点证书在端口443上具有Https Input端点,因此我不想更改/影响整个角色。

If it is helpful the service is a WCF Service which consumes an Mtom encoded soap 1.2 message 如果有帮助,则该服务为WCF服务,它消耗Mtom编码的soap 1.2消息

here are the new values that we have entered, what else do I need? 这是我们输入的新值,我还需要什么?

<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>

thank you much 非常感谢你

Fixed through these steps: 通过以下步骤解决:

  • Added serviceCredentials.serviceCertificate (cert details for our cert) to the service behavior 向服务行为添加了serviceCredentials.serviceCertificate(我们的证书的证书详细信息)
  • Eliminated Endpoint behavior definitions 消除了端点行为定义
  • Changed the HttpsMtomTwoWay binding to securityMode=Message 将HttpsMtomTwoWay绑定更改为securityMode = Message

Now the message handlers handle the authentication exchange and external cert validation, then pass on to the transport endpoint, and we did not need to mess with the site wide SSL or endpoint settings. 现在,消息处理程序处理身份验证交换和外部证书验证,然后传递到传输终结点,并且我们无需弄乱站点范围的SSL或终结点设置。 Tested and verified with numerous 3rd parties. 经过众多第三方的测试和验证。

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

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