设置SSL以在Azure上使用WCF的步骤是什么?

Pro*_*ame 8 ssl wcf azure

请发布您为设置SSL以在Azure上使用WCF而采取的步骤.

我已成功上传我的有效证书(使用cspack)并与网站的其余部分一起工作,但在添加之后,我以前正在使用的WCF服务停止工作.(我得到的只是404错误回到Silverlight,这不是很有帮助.对任何想出更好的日志记录的人来说,我也可以这样做以帮助诊断问题!)

我在这个配置上尝试了很多变化:

<system.serviceModel>
     <!--start added for SSL--> 
    <bindings>
      <basicHttpBinding>
        <binding name="SecureBasicHttpBinding">
          <security mode="Transport">
            <transport clientCredentialType="None"  />
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
     <!--end added for SSL--> 
    <behaviors>
      <!--start added for SSL--> 
      <endpointBehaviors>
        <behavior name="DisableServiceCertificateValidation">
          <clientCredentials>
            <serviceCertificate>
              <authentication certificateValidationMode="None"
                              revocationMode="NoCheck" />
            </serviceCertificate>
          </clientCredentials>
        </behavior>
      </endpointBehaviors>
      <!--start added for SSL--> 
      <serviceBehaviors>
        <behavior name="Silverheat.Cloud_WebRole.API.DataServiceBehavior">
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
          <!-- certificate checking removed --> 
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
    <services>
      <service behaviorConfiguration="Silverheat.Cloud_WebRole.API.DataServiceBehavior"
          name="Silverheat.Cloud_WebRole.API.DataService">
        <!--<endpoint address="" binding="basicHttpBinding" contract="Silverheat.Cloud_WebRole.API.DataService" />-->
        <endpoint bindingConfiguration="SecureBasicHttpBinding"
                  behaviorConfiguration="DisableServiceCertificateValidation"
                  address="" binding="basicHttpBinding"
                  contract="Silverheat.Cloud_WebRole.API.DataService" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>
    </services>
  </system.serviceModel>
Run Code Online (Sandbox Code Playgroud)

不幸的是,调试这个并获取更多信息非常困难,因为我无法单步调试任何配置,就像我在实时服务器上使用一样,因为绑定标签在调试时有问题(但不是实时).

感谢您的帮助和关注!

Pro*_*ame 7

哇!它还活着!它的工作!!

仍然无法在调试(安全异常)中工作,但我将继续使用它直到下一个版本.

这是有效的配置:

  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="SecureBasicHttpBinding">
          <security mode="Transport">
            <transport clientCredentialType="None"  />
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="Silverheat.Cloud_WebRole.API.DataServiceBehavior">
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
    <services>
      <service behaviorConfiguration="Silverheat.Cloud_WebRole.API.DataServiceBehavior"
          name="Silverheat.Cloud_WebRole.API.DataService">
        <endpoint bindingConfiguration="SecureBasicHttpBinding"
          address="" binding="basicHttpBinding"
          contract="Silverheat.Cloud_WebRole.API.DataService" />
        <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
      </service>
    </services>
  </system.serviceModel>
Run Code Online (Sandbox Code Playgroud)

(我认为是"mexHttpsBinding"使它最终起作用,虽然我不完全理解为什么它在已经配置之后需要元数据,我想回到书中)

我仍然想知道如何为WCF启用某种日志记录,但我会更多地浏览这个伟大的网站,我相信我会找到答案.