Could not find a base address that matches scheme https for the endpoint with binding WebHttpBinding. Registered base address schemes are [http]

C#WcfRestHttpsWeb Config

C# Problem Overview


I've been through several web site that suggest solution to this problem, but still I can't get rid of it.

My WebConfig:

<bindings>
  <webHttpBinding>
	<binding name="SecureBasicRest">
	  <security mode="Transport" />
	</binding>
  </webHttpBinding>
</bindings>
<behaviors>
  <serviceBehaviors>
	<behavior name="svcBehavior">
	  <serviceMetadata httpsGetEnabled="true"/>
	  <serviceDebug includeExceptionDetailInFaults="false"/>
	</behavior>
  </serviceBehaviors>
  <endpointBehaviors>
	<behavior name="svcEndpoint">
	  <webHttp helpEnabled="true"/>
	  <enableWebScript/>
	</behavior>
  </endpointBehaviors>
</behaviors>
<services>
  <service name="SvcContract.Authenticate" behaviorConfiguration="svcBehavior">
	<endpoint binding="webHttpBinding" bindingConfiguration="SecureBasicRest"
              behaviorConfiguration="svcEndpoint" name="webHttp"
              contract="SvcContract.Authenticate" />
  </service>
</services>  

Hope someone could help. Thanks in advance!.

Edit

I have to make this work with
https://localhost:6188/Authenticate/Login?username=user&password=pass&ip=127.0.0.1

C# Solutions


Solution 1 - C#

Change

<serviceMetadata httpsGetEnabled="true"/>

to

<serviceMetadata httpsGetEnabled="false"/>

You're telling WCF to use https for the metadata endpoint and I see that your'e exposing your service on http, and then you get the error in the title.

You also have to set <security mode="None" /> if you want to use HTTP as your URL suggests.

Solution 2 - C#

You would need to enable https binding on server side. IISExpress in this case. Select Properties on website project in solution explorer (not double click). In the properties pane then you need to enable SSL.

Solution 3 - C#

I solved the issue by adding https binding in my IIS websites and adding 443 SSL port and selecting a self signed certificate in binding.

enter image description here

Solution 4 - C#

To make it work you have to replace a run this line of code serviceMetadata httpGetEnabled="true"/> http instead of https and security mode="None" />

Solution 5 - C#

In the endpoint tag you need to include the property address=""

<endpoint address="" binding="webHttpBinding" bindingConfiguration="SecureBasicRest" behaviorConfiguration="svcEndpoint" name="webHttp" contract="SvcContract.Authenticate" />

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionfiberOpticsView Question on Stackoverflow
Solution 1 - C#Per KastmanView Answer on Stackoverflow
Solution 2 - C#SoftecView Answer on Stackoverflow
Solution 3 - C#Bimal DasView Answer on Stackoverflow
Solution 4 - C#MrTony78View Answer on Stackoverflow
Solution 5 - C#Jose LopezView Answer on Stackoverflow