title: Allow web service to serve both request http and https?
body: <pre><code>  &lt;system.serviceModel&gt;
      &lt;services&gt;
        &lt;service behaviorConfiguration="Complete_Html5.CompleteService.CompleteServiceAspNetAjaxBehavior" name="Complete_Html5.CompleteService.Complete"&gt;
          &lt;endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_Complete" contract="Complete_Html5.CompleteService.Complete" /&gt;
          &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /&gt;
        &lt;/service&gt;
        &lt;service name="Complete_Html5.Service1" behaviorConfiguration="Complete_Html5.Service1ServiceAspNetAjaxBehavior"&gt;
          &lt;endpoint address="" binding="basicHttpBinding" contract="Complete_Html5.Service1" /&gt;
          &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /&gt;
        &lt;/service&gt;
      &lt;/services&gt;
  
      &lt;behaviors&gt;
        &lt;endpointBehaviors&gt;
          &lt;behavior name="Complete_Html5.Service1AspNetAjaxBehavior"&gt;
            &lt;enableWebScript /&gt;
          &lt;/behavior&gt;
          &lt;behavior name="Complete_Html5.CompleteService.CompleteServiceAspNetAjaxBehavior"&gt;
            &lt;enableWebScript /&gt;
          &lt;/behavior&gt;
        &lt;/endpointBehaviors&gt;      
        &lt;serviceBehaviors&gt;
          &lt;behavior name="Complete_Html5.CompleteService.CompleteServiceAspNetAjaxBehavior"&gt;
            &lt;serviceMetadata httpGetEnabled="true" /&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt;
          &lt;/behavior&gt;        
          &lt;behavior name="Complete_Html5.Service1ServiceAspNetAjaxBehavior"&gt;
            &lt;serviceMetadata httpGetEnabled="true" /&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt;
          &lt;/behavior&gt;        
        &lt;/serviceBehaviors&gt;      
      &lt;/behaviors&gt;
  
      &lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /&gt;
      &lt;bindings&gt;
        &lt;basicHttpBinding&gt;
          &lt;binding name="BasicHttpBinding_Complete" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="10485760" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"&gt;
            &lt;readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /&gt;
  
            &lt;security mode="None"&gt;
              &lt;transport clientCredentialType="None" proxyCredentialType="None" realm="" /&gt;
              &lt;message clientCredentialType="UserName" algorithmSuite="Default" /&gt;
            &lt;/security&gt;
          &lt;/binding&gt;
          &lt;binding name="BasicHttpBinding_Complete1" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"&gt;
            &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt;
            &lt;security mode="None"&gt;
              &lt;transport clientCredentialType="None" proxyCredentialType="None" realm="" /&gt;
              &lt;message clientCredentialType="UserName" algorithmSuite="Default" /&gt;
            &lt;/security&gt;
          &lt;/binding&gt;
          &lt;binding name="BasicHttpBinding_Service1" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="10485760" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true" messageEncoding="Text"&gt;
            &lt;readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /&gt;
            &lt;security mode="None"&gt;
              &lt;transport clientCredentialType="None" proxyCredentialType="None" realm="" /&gt;
              &lt;message clientCredentialType="UserName" algorithmSuite="Default" /&gt;
            &lt;/security&gt;
          &lt;/binding&gt;
          &lt;binding name="BasicHttpBinding_Service11" /&gt;
        &lt;/basicHttpBinding&gt;
      &lt;/bindings&gt;
      &lt;client&gt;
        &lt;endpoint address="http://www.examplete.com:83/CompleteService/Complete.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_Complete" contract="Complete_Html5.CompleteService.Complete" name="BasicHttpBinding_Complete" /&gt;
        &lt;endpoint address="http://www.examplete.com:83/CompleteService/Complete.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_Complete1" contract="PMCService.Complete" name="BasicHttpBinding_Complete1" /&gt;
        &lt;endpoint address="http://www.examplete.com:83/Service1.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_Service1" contract="ReportService.Service1" name="BasicHttpBinding_Service1" /&gt;
        &lt;endpoint address="http://www.examplete.com:83/Service1.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_Service11" contract="ReportService.Service1" name="BasicHttpBinding_Service11" /&gt;
      &lt;/client&gt;
    &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>Above is the <code>service</code> setting in <code>web.config</code> what changes I have to make so that I could use both hits <code>http</code> and <code>https</code> while accessing <code>website</code>??</p>
  
  <p>We have added ssl certificate to server and have unchecked <code>required ssl</code> from website <code>ssl</code> certificate setting.</p>
  
  <p><a href="https://i.stack.imgur.com/81d1s.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/81d1s.png" alt="enter image description here"></a>
   It it working fine <code>http</code> but when hits come is website is with <code>https</code> it's throwing error as:</p>
  
  <blockquote>
    <p>The provided URI scheme <code>https</code> is invalid; Expected <code>http</code>. Parameter
    name: via.</p>
  </blockquote>
  
  <p>How to solve this so that allow both hits <code>http</code> and <code>https</code>?</p>
  
  <blockquote>
    <p>This is specially when we calling web service method.!</p>
  </blockquote>
  
  <p>Have tried by adding <code>httpsGetEnabled="true"</code> in serviceMetadata element but still not working..!</p>