2013-08-29 31 views
0

嘗試在Windows XP上配置自託管WCF服務的SSL端點。我的配置在Windows 7上正常工作;但Windows XP,使用相同的證書,不響應。我得到一個服務器未找到錯誤。Win XP上的自託管WCF SSL失敗

當我運行netstat -an時,我可以看到該服務正在偵聽端口443.沒有衝突的應用程序偵聽端口並且防火牆關閉。

有沒有人見過這個?任何想法如何解決?

運行httpcfg query ssl產生如下:

C:\Documents and Settings\Kane>httpcfg query ssl 
    IP      : 0.0.0.0:443 
    Hash     : 4857fcdc71a69b8df67bb7cb7c6fb1073a08f23 
    Guid     : {00000000-0000-0000-0000-000000000000} 
    CertStoreName   : (null) 
    CertCheckMode   : 0 
    RevocationFreshnessTime : 0 
    UrlRetrievalTimeout  : 0 
    SslCtlIdentifier  : (null) 
    SslCtlStoreName   : (null) 
    Flags     : 0 
------------------------------------------------------------------------------ 
    IP      : 0.0.0.0:8443 
    Hash     : 4857fcdc71a69b8df67bb7cb7c6fb1073a08f23 
    Guid     : {00000000-0000-0000-0000-000000000000} 
    CertStoreName   : (null) 
    CertCheckMode   : 0 
    RevocationFreshnessTime : 0 
    UrlRetrievalTimeout  : 0 
    SslCtlIdentifier  : (null) 
    SslCtlStoreName   : (null) 
    Flags     : 0 
------------------------------------------------------------------------------ 

下面是我的配置文件:

<?xml version="1.0"?> 
<configuration> 
    <system.web> 
    <compilation debug="true" targetFramework="4.0"/> 
    </system.web> 
    <system.serviceModel> 
    <protocolMapping> 
     <add binding="webHttpBinding" scheme="http"/> 
    </protocolMapping> 
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="false"/> 
    <services> 
     <service name="SomeWindowsService.SomeService" behaviorConfiguration="webServiceBehaviorConfig"> 
     <host> 
      <baseAddresses> 
      <add baseAddress="http://*:8080/"/> 
      <add baseAddress="https://*/ssl/"/> 
      </baseAddresses> 
     </host> 
     <!-- this endpoint is exposed at the base address provided by host: http://localhost:8080/someservice --> 
     <endpoint address="" binding="webHttpBinding" behaviorConfiguration="WebHttpEndPointBehaviour" contract="SomeWindowsService.IFileAccessService"/> 
     <endpoint name="someservice" address="someservice" binding="basicHttpBinding" bindingConfiguration="soapBindingConfig" contract="someservice"/> 
     <endpoint name="someserviceSSL" address="ssl/someservice" binding="basicHttpBinding" bindingConfiguration="sslBindingConfig" contract="someservice"/> 
     <endpoint address="mex" binding="mexHttpBinding" name="MetadataBinding" contract="IMetadataExchange"/> 
     </service> 
    </services> 
    <!--Bindings--> 
    <bindings> 
     <basicHttpBinding> 
     <binding name="soapBindingConfig" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"> 
      <security mode="None"/> 
      <readerQuotas maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxDepth="2147483647" maxNameTableCharCount="2147483647" maxStringContentLength="2147483647" /> 
     </binding> 
     <binding name="sslBindingConfig" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"> 
      <security mode="Transport"/> 
      <readerQuotas maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxDepth="2147483647" maxNameTableCharCount="2147483647" maxStringContentLength="2147483647" /> 
     </binding> 
     </basicHttpBinding> 
    </bindings> 
    <!--Behaviors--> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="webServiceBehaviorConfig"> 
      <serviceDebug includeExceptionDetailInFaults="true"/> 
      <serviceMetadata httpGetEnabled="true" httpGetUrl="mex" httpsGetEnabled="true" httpsGetUrl="mex" /> 
      <dataContractSerializer maxItemsInObjectGraph="2147483647"/> 
     </behavior> 
     </serviceBehaviors> 
     <endpointBehaviors> 
     <behavior name="WebHttpEndPointBehaviour"> 
      <webHttp/> 
     </behavior> 
     </endpointBehaviors> 
    </behaviors> 
    </system.serviceModel> 
    <system.webServer> 
    <modules runAllManagedModulesForAllRequests="true"/> 
    </system.webServer> 

    <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/><AutoStartTerminals>false</AutoStartTerminals></startup></configuration> 
+0

奇怪的是,我沒有從瀏覽器或任何東西獲得證書警告。就好像沒有人在聽。如果有幫助,我會從提琴手那裏得到一個http 502。 –

回答

0

好了,所以要了解是什麼原因導致這個問題,我不得不先打開SCHANNEL錯誤日誌( http://support.microsoft.com/kb/260729)。

Under:HKEY_LOCAL_MACHINE \ System \ CurrentControlSet \ Control \ SecurityProviders \ SCHANNEL,我添加了一個新的reg DWORD:EventLogging,值爲7.然後重新啓動計算機。

然後看日誌,我看到錯誤:

事件類型:錯誤 事件源:Schannel 事件類別:無 事件ID:36870 日期:2013年8月29日 時間:8: 03:07 PM 用戶:N/A 計算機:DEVELOPMENT 說明: 嘗試訪問SSL服務器憑證私鑰時發生致命錯誤。從加密模塊返回的錯誤代碼是0x80090016。

欲瞭解更多信息,請參閱幫助和支持中心http://go.microsoft.com/fwlink/events.asp

這個錯誤使我對下面的文章:http://support.microsoft.com/kb/939616搜索谷歌後:「一個致命的錯誤0x80090016」

我重新導入證書和問題得到解決。

關鍵是從Windows註銷。這是記錄,提醒我的證書問題。