2013-08-29 32 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注销。这是记录,提醒我的证书问题。