2009-03-03 14 views
7

Proszę, opublikuj kroki podjęte w celu skonfigurowania SSL do pracy z WCF na Azure.Jakie są kroki, aby skonfigurować SSL do pracy z WCF na Azure?

Mam pomyślnie valid certificate uploaded (using cspack) i pracuję z resztą witryny, ale po dodaniu go moja działająca usługa WCF przestała działać. (Otrzymuję tylko błąd 404 z powrotem do Silverlight, co nie jest zbyt pomocne.Od głosowania na kogoś, kto wymyśli lepsze rejestrowanie, mógłbym też pomóc w zdiagnozowaniu problemu!)

Próbowałem wielu wariacje na temat tej konfiguracji:

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

Niestety debugowanie to i coraz więcej informacji jest bardzo trudne, ponieważ nie mogę przejść przez i debugowania z dowolnej konfiguracji zdalnie jak użyję na żywo serwera, ponieważ bindings tag has problems na debugowania (ale nie żyć).

Dzięki za pomoc i zainteresowanie!

Odpowiedz

6

Wow! To żyje! To działa!!

Nadal nie działa w debugowaniu (security exception), ale będę z tym żyć do następnego wydania.

Oto konfiguracja który pracował:

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

(myślę, że to była „mexHttpsBinding”, które sprawiły, że w końcu działa, choć nie do końca rozumiem, dlaczego to musi metadanych po jej już skonfigurowany, z powrotem do książki, jak sądzę)

Chciałbym jeszcze wiedzieć, jak włączyć logowanie do WCF, ale będę trochę więcej przeglądać tę wspaniałą stronę i jestem pewien, że znajdę odpowiedź.