【问题标题】:C# Elastic Beanstalk webapp , could not find a base address that matches scheme https for endpoint with webhttpbinding.C# Elastic Beanstalk webapp ,找不到与带有 webhttpbinding 的端点的方案 https 匹配的基地址。
【发布时间】:2015-09-29 16:54:43
【问题描述】:

基本上我想创建一个 https 安全的 Restful WCF 服务。因此,我将 webhttpbinding 用于我的服务,因为它支持创建 RESTful 服务。最好我本来想用单实例 EBS 来做,但 EBS 不支持 SSL 证书。在 C#/.net 平台上进行配置,所以我设置了一个负载均衡器,将我的证书上传到 IAM 并在 ELB 上打开了侦听器。但无论我做什么,我的 web.config 似乎都不起作用。你能帮我弄清楚我的web.config ...`

<system.web>
  <compilation debug="true" targetFramework="4.5" />
  <httpRuntime targetFramework="4.5" />
  <customErrors mode="Off" />
</system.web>

<system.serviceModel>
    <bindings>
        <webHttpBinding>
            <binding name="webHttpBinding_ICustomerService" crossDomainScriptAccessEnabled="true">
                <security mode="Transport">
                  <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
                </security>
            </binding>
        </webHttpBinding>
    </bindings>
    <client>
        <endpoint address="http://localhost:44300/CustomerService/CustomerService.svc"
            binding="basicHttpsBinding" bindingConfiguration="" contract="WcfService2.ICustomerService"
            name="" kind="" endpointConfiguration="" />
    </client>
    <services>
        <service name="WcfService2.Service1" behaviorConfiguration="ServiceBehavior">
            <endpoint address="" binding="webHttpBinding" bindingConfiguration="webHttpBinding_ICustomerService"
                behaviorConfiguration="webHttpBehavior" contract="WcfService2.ICustomerService">
            <identity>
              <dns value="localhost" />
            </identity>
            </endpoint>
          <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
        </service>
    </services>

  <behaviors>
    <serviceBehaviors>
      <behavior name="ServiceBehavior">
        <serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" httpsGetUrl="mex"/>
        <serviceDebug includeExceptionDetailInFaults="true"/>
      </behavior>
    </serviceBehaviors>
    <endpointBehaviors>
      <behavior name="webHttpBehavior">
        <webHttp/>
      </behavior>
    </endpointBehaviors>
  </behaviors>
  <serviceHostingEnvironment aspNetCompatibilityEnabled="true" minFreeMemoryPercentageToActivateService="0" multipleSiteBindingsEnabled="true">
    <baseAddressPrefixFilters>
      <add prefix="https://example.com/" />
    </baseAddressPrefixFilters>
  </serviceHostingEnvironment>
</system.serviceModel>

`

【问题讨论】:

    标签: c# asp.net wcf ssl https


    【解决方案1】:

    您似乎在端点上使用了 basicHttpsBinding,同时提供了 http:// 地址,这将导致方案不匹配错误。

    【讨论】:

    • 没有帮助,即使我改变它也没有区别,我得到同样的错误。 无论如何都是用于本地 wcf 客户端的,在我将它部署到 Beanstalk 之后应该没关系。
    猜你喜欢
    • 1970-01-01
    • 2012-04-06
    • 2021-07-29
    • 1970-01-01
    • 2012-05-04
    • 1970-01-01
    • 1970-01-01
    • 2010-09-26
    相关资源
    最近更新 更多