2009-03-03 33 views
7

Hãy đăng các bước bạn đã thực hiện để thiết lập SSL để làm việc với WCF trên Azure.Các bước để thiết lập SSL để làm việc với WCF trên Azure là gì?

Tôi có valid certificate uploaded thành công (using cspack) và làm việc với phần còn lại của trang web, nhưng sau khi thêm, dịch vụ WCF trước đây của tôi ngừng hoạt động. (Tất cả những gì tôi nhận được là lỗi 404 trở lại Silverlight, điều này không hữu ích lắm. Bỏ phiếu cho bất kỳ ai cũng đến với một số đăng nhập tốt hơn tôi cũng có thể làm để chẩn đoán vấn đề!)

Tôi đã thử nhiều các biến thể trên cấu hình này:

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

thật không may, gỡ lỗi này và nhận được thông tin hơn là thực sự khó khăn vì tôi không thể bước qua và gỡ lỗi với bất kỳ cấu hình từ xa như tôi muốn sử dụng trên máy chủ sống vì bindings tag has problems trên debug (nhưng không sống).

Cảm ơn sự giúp đỡ và sự quan tâm của bạn!

Trả lời

6

Wow! Nó còn sống! Làm việc của nó !!

Vẫn không hoạt động trong gỡ lỗi (security exception), nhưng tôi sẽ sống với điều đó cho đến bản phát hành tiếp theo.

Dưới đây là các cấu hình mà làm việc:

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

(Tôi nghĩ đó là "mexHttpsBinding" mà làm cho nó cuối cùng làm việc, mặc dù tôi không hoàn toàn hiểu tại sao nó cần dữ liệu meta sau khi nó đã được cấu hình, trở lại những cuốn sách tôi đoán)

Tôi vẫn muốn biết cách bật một số loại ghi nhật ký cho WCF, nhưng tôi sẽ xem xét trang web tuyệt vời này nhiều hơn một chút và tôi chắc chắn tôi sẽ tìm thấy câu trả lời.

Các vấn đề liên quan