【问题标题】:WCF Security and config help - base address for https not foundWCF 安全和配置帮助 - 未找到 https 的基地址
【发布时间】:2010-07-14 18:54:10
【问题描述】:

我在 Windows 托管服务的事件日志中收到此错误。

服务无法启动。
System.InvalidOperationException: 找不到一个基地址 匹配端点的方案 https 与绑定 BasicHttpBinding。 注册的基地址方案是 [http]。

这项服务一直有效,直到最近我们想添加一些安全功能。这是我的basicHttpBinding 节点和我的服务节点。

<basicHttpBinding>
    <binding name="BasicHttpBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" transferMode="Buffered" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="52428800" maxBufferSize="65536000" maxReceivedMessageSize="65536000">
      <readerQuotas maxDepth="32" maxStringContentLength="1819200" maxArrayLength="1638400" maxBytesPerRead="1409600" maxNameTableCharCount="1638400" />
        <security mode="TransportWithMessageCredential" >
            <message clientCredentialType="UserName"/>
        </security>
    </binding>
  </basicHttpBinding>
  <service behaviorConfiguration="CKISServiceBehavior" name="tcore.CKWcfService.CKISService">
     <endpoint address="CKISService" 
               binding="basicHttpBinding" 
               bindingConfiguration="BasicHttpBinding" 
               bindingNamespace="http://ws.jcore.com" 
               contract="jcore.Common.ICKISService" />
     <endpoint address="mex" 
               binding="mexHttpsBinding" 
               contract="IMetadataExchange" />
     <host>
        <baseAddresses>
           <add baseAddress="https://localhost:9303" />
        </baseAddresses>
     </host>
 </service>
 <behavior name="CKISServiceBehavior">
     <serviceThrottling maxConcurrentCalls="300" maxConcurrentSessions="300" maxConcurrentInstances="400" />
     <serviceMetadata httpsGetEnabled="true" />
     <serviceDebug includeExceptionDetailInFaults="false" />
 </behavior>

知道这里发生了什么吗?我的服务将不再启动,它告诉我我的基地址设置不正确。我该如何解决这个问题?

【问题讨论】:

  • 我也进行了搜索,发现了一个与我遇到的问题相似的问题。您是否在负载均衡器后面运行此服务?如果是,LB 是以 HTTPS 还是 HTTP 将请求传递给服务?我的将它作为 HTTP 传递。这是来自 SO 的类似问答:stackoverflow.com/questions/363285/…

标签: c# wcf configuration wcf-binding wcf-security


【解决方案1】:

在 IIS 中启用 Require SSL 时,有时我会遇到此问题。我认为您可能需要使用命令行配置您的 ssl 主机标头。

http://www.hosting.com/support/iis7/configure-ssl-host-headers-in-iis7

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-09-02
    • 2010-09-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-03-11
    • 1970-01-01
    相关资源
    最近更新 更多