wcfhttpswcf-hosting

The provided URI scheme 'https' is invalid; expected 'http'. Parameter name: via for HTTPS


Following is the scenario.

We have F5 load balancer and incoming requests comes in to the F5 load balancer as HTTPs and then they are redirected to WCF services server as HTTP.

I have tried almost all possible configuration combinations but it keeps giving two different errors. For example, in light of few suggestions, I have tried changing security mode to 'Transport' then the error changes to as follows: "Could not establish secure channel for SSL/TLS with authority 'xxx.xxx.xxx.xxx:XXXX'."

Server Configuration:

<system.serviceModel>
    <services>
      <service behaviorConfiguration="NameofServiceBehaviour" name="NameOfServices">
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="wsHttpEndPointBinding" name="wsHttpEndPoint" contract="Name.IContractName" />
      </service>
    </services>
    <bindings>
      <wsHttpBinding>
        <binding name="wsHttpEndPointBinding">
          <security mode="None"> 
        <!-- <transport clientCredentialType="Certificate" /> -->
      </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehaviourName">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
          <!-- <serviceCredentials>
            <serviceCertificate findValue="CN=CertificateName" storeLocation="LocalMachine" />
          </serviceCredentials> -->
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="false" />
  </system.serviceModel>

Client Configuration:

<system.serviceModel>
        <bindings>
            <wsHttpBinding>
                <binding name="wsHttpEndPoint">
                    <security mode="None" />
                </binding>
            </wsHttpBinding>
        </bindings>
        <client>
            <endpoint address="https://URL.svc"
                binding="wsHttpBinding" bindingConfiguration="wsHttpEndPoint"
                contract="Name.IContractName" name="wsHttpEndPoint" />
        </client>
    </system.serviceModel>

Regards, Nasir


Solution

  • I found the answer with this link. The key was to set the following parameters in the custom binding:

    <security allowInsecureTransport="true" enableUnsecuredResponse="true">