5

I am trying to configure a REST WCF service over SSL and I keep getting:

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

Can somebody please take a look at my config file? Thanks.

 <system.web> <compilation debug="true" targetFramework="4.0" /> </system.web> <system.serviceModel> <bindings> <wsHttpBinding> <binding name="wsHttpBinding1"> <security> <message clientCredentialType="UserName" /> </security> </binding> </wsHttpBinding> <mexHttpsBinding> <binding name="mexHttpsBinding1"/> </mexHttpsBinding> <webHttpBinding> <binding name="webHttpBinding1"> <security mode="Transport" /> </binding> </webHttpBinding> </bindings> <services> <service behaviorConfiguration="serviceBehavior" name="CompanyX.WebServices.WebApi"> <endpoint address="" behaviorConfiguration="WebApiBehavior" binding="webHttpBinding" bindingConfiguration="webHttpBinding1" contract="CompanyX.WebServices.IWebApi"> <identity> <certificateReference x509FindType="FindBySubjectName" findValue="CompanyXDev" isChainIncluded="false" storeName="My" storeLocation="LocalMachine" /> </identity> </endpoint> <endpoint binding="mexHttpsBinding" bindingConfiguration="mexHttpsBinding1" name="mex" contract="IMetadataExchange" /> </service> </services> <behaviors> <endpointBehaviors> <behavior name="WebApiBehavior"> <webHttp /> </behavior> </endpointBehaviors> <serviceBehaviors> <behavior name="serviceBehavior"> <serviceMetadata httpsGetEnabled="true" httpGetBinding="" httpsGetBinding="webHttpBinding" httpsGetBindingConfiguration="webHttpBinding1" /> <serviceDebug includeExceptionDetailInFaults="true" /> <serviceCredentials> <clientCertificate> <certificate findValue="CompanyXDev" x509FindType="FindBySubjectName" /> </clientCertificate> <serviceCertificate findValue="CompanyXDev" x509FindType="FindBySubjectName" /> <userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="CompanyX.WebServices.CredentialsValidator, CompanyX.WebServices" /> <peer> <certificate findValue="CompanyXDev" storeLocation="LocalMachine" x509FindType="FindBySubjectName" storeName="My" /> </peer> <issuedTokenAuthentication> <knownCertificates> <add findValue="CompanyXDev" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName" /> </knownCertificates> </issuedTokenAuthentication> </serviceCredentials> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/> </system.serviceModel> <system.webServer> <modules runAllManagedModulesForAllRequests="true"/> </system.webServer> </configuration> 
3
  • 5
    Looks like you have little bit over configured your service host, didn't you? Commented Jan 10, 2011 at 21:56
  • Ladislav Mrnka comment made me laugh, +1. Commented Jan 10, 2011 at 22:22
  • Oh look, another poor soul chasing that mythical notion of a service that is both RESTful and RPC. Commented Jan 10, 2011 at 23:13

3 Answers 3

5

Let me guess: You are running your service from Visual Studio in Developement web server (Cassini), don't you? Development web server does not support HTTPS. You have to host your service in IIS and follow Greg's advice to add HTTPS binding for the site.

Sign up to request clarification or add additional context in comments.

Comments

3

You need to add a https binding in IIS.

  1. Navigate to your site in IIS
  2. Click 'Bindings...' in the Actions panel on the right.
  3. Click 'Add'
  4. Select 'https' and select a certificate.

Comments

2

Two choices:

  1. Specify the full address in the endpoints.

  2. Specify somewhere in the tag the base addresses used for the host, for example:

<host> <baseAddresses> <add baseAddress="http://localhost:8000/service"/> <add baseAddress="https://localhost:8001/service"/> </baseAddresses> </host> 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.