Connect to a WCF Service over HTTPS

34 views Asked by At

I have a .NET Framework 4.5 web application thats meant to connect to a service over HTTP but I need to change it so its over HTTPS. I have a SSL certificate installed on the server with a HTTPS redirect. Turning off the HTTPS redirect allows the application to connect, but I need HTTPS

This is an extract of web.config of the web application

<system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="HttpBinding_ULookup" />
         <security mode="Transport">
           <transport clientCredentialType="None"></transport>
         </security>
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="https://myapps.intranet.net/services/users/lookup.svc" binding="basicHttpBinding" bindingConfiguration="HttpBinding_ULookup" contract="Users.Lookup" name="HttpBinding_ULookup" />
    </client>
  </system.serviceModel>

This is an extract of web.config of the service

  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="">
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  </system.serviceModel>

Tried adding

<security mode="Transport">
           <transport clientCredentialType="None"></transport>
         </security>

but this didnt work.

This is the error I get

An error has occurred. An error occurred while receiving the HTTP response to http://myapps.intranet.net/services/users/lookup.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.

0

There are 0 answers