如何在WCF服务中启用HTTPS

dsi

我已经在IIS上托管了我的服务。

托管服务已应用SSL证书,并且在浏览URL时显示为HTTPS。

但是,当我确实将此URL消费到客户端应用程序(ASP.NET WEB应用程序)中时,它允许添加,https//domain/service.svc但是在客户端配置上,URL显示为http和而不是https然后进行手动更改时,会出现以下错误:The provided URI scheme 'https' is invalid; expected 'http'.

以下是WCF服务配置(在IIS上托管):

<system.serviceModel>
<behaviors>
  <serviceBehaviors>
    <behavior name="customBehavior">
      <serviceMetadata httpsGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>

<bindings>
  <basicHttpBinding>
    <binding name="basicBindingConfiguration" closeTimeout="00:05:00"
            openTimeout="00:05:00" receiveTimeout="00:10:00" sendTimeout="00:05:00"
            allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
            maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
            messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
            useDefaultWebProxy="true">
      <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
          maxBytesPerRead="4096" maxNameTableCharCount="16384" />

      <security mode="None">

      </security>
    </binding>
  </basicHttpBinding>
</bindings>

<serviceHostingEnvironment  multipleSiteBindingsEnabled="true" minFreeMemoryPercentageToActivateService="0" />
<services>
  <service name="Administrator.OAP.CRMServices.CRMServices"
           behaviorConfiguration="customBehavior">
    <endpoint address=""
              binding="basicHttpBinding"
              bindingConfiguration="basicBindingConfiguration"
              contract="Administrator.OAP.CRMServices.Contracts.ICRMServices" />
  </service>
</services>

任何人都可以指导我什么问题或需要进行更改才能仅通过HTTPS使用此服务吗?

托马斯

您的绑定具有以下内容:

<security mode="None">

这意味着您的服务不希望使用任何类型的安全性。HTTPS是传输身份验证,因此您需要设置:

<security mode="Transport">

以下链接包含有关在WCF中设置传输安全性的有用信息:http : //msdn.microsoft.com/zh-cn/library/ms733043 (v= vs.110).aspx

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

如何在WCF RESTful服务上启用HTTPS?

来自分类Dev

启用HTTPS的IIS托管WCF服务,如何保护它?

来自分类Dev

如何在启用COM互操作的DLL中引用WCF服务?

来自分类Dev

如何在libcurl中启用https支持?

来自分类Dev

如何在 IIS 中启用 https?

来自分类Dev

如何在具有Https / ssl的tomcat服务器中启用GZIP

来自分类Dev

如何在Snap服务器上启用HTTPS?

来自分类Dev

如何在 beaglebone black 中启用服务?

来自分类Dev

如何在Windows 10中启用服务器服务?

来自分类Dev

如何在WCF服务中安排和展示服务?

来自分类Dev

如何在Jetbrains Upsource 2.0中启用HTTPS

来自分类Dev

如何在mvc6中启用https

来自分类常见问题

如何在systemd服务单元中启用virtualenv?

来自分类Dev

如何在SharePoint 2013中启用InfoPath服务?

来自分类Dev

如何在.NET中启用或禁用Windows服务?

来自分类Dev

如何在Swift中为WKWebView启用位置服务?

来自分类Dev

如何在PUMA服务器中启用GZIP

来自分类Dev

如何在SharePoint 2013中启用InfoPath服务?

来自分类Dev

如何在Intellij Idea 12中启用RESTful Web服务?

来自分类Dev

如何在Nixos的Apache服务配置中启用PHP?

来自分类Dev

如何在 Telerik Reporting CORS REST 服务中启用 SSL

来自分类Dev

如何在 PCF 中启用 Nfs 卷服务

来自分类Dev

WCF服务启用跟踪

来自分类Dev

如何在VS 2013中公开托管WCF服务

来自分类Dev

如何在服务响应中显示WCF HTTP代码

来自分类Dev

如何在wcf rest服务中读取json数组

来自分类Dev

如何在AWS Docker上启用HTTPS

来自分类Dev

如何使用PowerShell在Windows 10上启用WCF服务?

来自分类Dev

如何在Android中调用https Web服务