Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/291.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在我的WCF服务上配置HTTPS有问题_C#_Wcf_Iis_Https - Fatal编程技术网

C# 在我的WCF服务上配置HTTPS有问题

C# 在我的WCF服务上配置HTTPS有问题,c#,wcf,iis,https,C#,Wcf,Iis,Https,我正在尝试将传输安全层添加到我的WCF服务中。但在遵循所有说明之后,我仍然得到错误“无法找到与绑定BasicHttpBinding的端点的方案https匹配的基址。注册的基址方案为[http]” 已经在IIS管理器中完成了所有需要的配置,并在web.config中添加了需要的代码,但我仍然觉得我遗漏了一些东西 web.config: <system.serviceModel> <services> <ser

我正在尝试将传输安全层添加到我的WCF服务中。但在遵循所有说明之后,我仍然得到错误“无法找到与绑定BasicHttpBinding的端点的方案https匹配的基址。注册的基址方案为[http]”

已经在IIS管理器中完成了所有需要的配置,并在web.config中添加了需要的代码,但我仍然觉得我遗漏了一些东西

web.config:

   <system.serviceModel>   
          <services>
              <service name="MyNameSpace.MyService" behaviorConfiguration="secureBehavior">                     
                <endpoint address="" binding="basicHttpBinding" bindingConfiguration="secureHttpBinding" contract="MyNameSpace.IMyService" />
                <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
              </service>          
            </services>

        <bindings>
          <basicHttpBinding>
            <binding name="secureHttpBinding">
              <security mode="Transport">
                <transport clientCredentialType="None" />
              </security>
            </binding>
          </basicHttpBinding>      
        </bindings>

        <behaviors>
          <serviceBehaviors>
            <behavior name="secureBehavior">
              <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
          </serviceBehaviors>
        </behaviors>    

        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
      </system.serviceModel>

您当前的配置没有问题,请配置https端点并使用传输安全模式。我们还需要做的一件事是在IIS绑定模块中配置https绑定地址。如下图所示。

它位于IIS站点绑定模块中。

然后我们可以使用上面的https服务地址访问它。
(服务基址)

如果问题仍然存在,请随时通知我。

您是否在服务器上启用了SSL?