无法在https网址

时间:2017-05-10 11:58:15

标签: c# web-services wcf ssl

今天我们打电话时遇到了问题" https"来自本地网站的WCF服务方法。当我们从localhost调用服务时,我们有以下错误消息。

"向" https://...."发出HTTP请求时发生错误。这可能是由于在HTTPS情况下未使用HTTP.SYS正确配置服务器证书。这也可能是由于客户端和服务器之间的安全绑定不匹配造成的。"

我们还通过" http://"提供相同的服务。在服务器上,它按预期工作。此外,我们使用SSL证书检查本地IIS中托管的相同服务,并且它在本地的工作也很好,所以现在我们坚持这一点。关于我们检查服务器或其他任何东西的正确配置的任何想法?

在这里,我分享我们的配置文件" https://"服务。



<?xml version="1.0"?>
<configuration>
  <connectionStrings>    
    <add name="VISION" connectionString="ConnectionString" providerName="System.Data.SqlClient" />
  </connectionStrings>
  <system.web>
    <compilation debug="true" targetFramework="4.5.2"/>
    <httpRuntime targetFramework="4.5.2"/>
    <httpModules>
      <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"/>
    </httpModules>
  </system.web>
  <system.serviceModel>
    <services>
      <service behaviorConfiguration="ServiceName.Service1Behavior"
        name="ServiceName.Integration_Service">
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="TransportSecurity"   
          bindingNamespace="" contract="ServiceName.Contracts.IEnquiry">
          <identity>           
          </identity>
        </endpoint>
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="TransportSecurity"
          bindingNamespace="" contract="ServiceName.Contracts.ITenant">
          <identity>
          </identity>
        </endpoint>
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="TransportSecurity"
          bindingNamespace="" contract="ServiceName.Contracts.ICreditInformation">
          <identity>
          </identity>
        </endpoint>
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="TransportSecurity"
          bindingNamespace="" contract="ServiceName.Contracts.IIncomeDetails">
          <identity>
          </identity>
        </endpoint>
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="TransportSecurity"
          bindingNamespace="" contract="ServiceName.Contracts.ITenantAddress">
          <identity>
          </identity>
        </endpoint>
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="TransportSecurity"
          bindingNamespace="" contract="ServiceName.Contracts.IAdditionalDetailOfApplicant">
          <identity>
          </identity>
        </endpoint>
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="TransportSecurity"
          bindingNamespace="" contract="ServiceName.Contracts.ITenantLinkStatus">
          <identity>
          </identity>
        </endpoint>
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="TransportSecurity"
          bindingNamespace="" contract="ServiceName.Contracts.IResendTenantLink">
          <identity>
          </identity>
        </endpoint>
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="TransportSecurity"
          bindingNamespace="" contract="ServiceName.Contracts.IGenerateReports">
          <identity>
          </identity>
        </endpoint>
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="TransportSecurity"
          bindingNamespace="" contract="ServiceName.Contracts.IGetApplicantStatus">
          <identity>
          </identity>
        </endpoint>
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="TransportSecurity"
          bindingNamespace="" contract="ServiceName.Contracts.IUploadDocument">
          <identity>
          </identity>
        </endpoint>
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="TransportSecurity"
          bindingNamespace="" contract="ServiceName.Contracts.ICompanyIncomeDetails">
          <identity>
          </identity>
        </endpoint>
	<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" /> 
      </service>
    </services>
    <bindings>
     
      <wsHttpBinding>  
        <binding name="TransportSecurity">  
          <security mode="Transport">  
            <transport clientCredentialType="None"/>  
          </security>  
        </binding>  
      </wsHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceName.Service1Behavior">
         <serviceMetadata httpsGetEnabled="true" httpGetEnabled="false"/>
          <dataContractSerializer maxItemsInObjectGraph="2147483646" />
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceThrottling maxConcurrentCalls="50" maxConcurrentSessions="50" />
        </behavior>
       
      </serviceBehaviors>
    </behaviors>
   
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="false"/>
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
      <remove name="ApplicationInsightsWebTracking"/>
      <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"
        preCondition="managedHandler"/>
    </modules>

    <directoryBrowse enabled="true"/>
    <validation validateIntegratedModeConfiguration="false"/>
  </system.webServer>

</configuration>
&#13;
&#13;
&#13;

如果您对此有更多需要,请将其还原。

提前致谢!!!

0 个答案:

没有答案