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>
<protocolMapping> Represents a configuration section for defining a set of default protocol mapping between transport protocol schemes (e.g., http, net. tcp, net. pipe, etc.) and WCF bindings.
WCF (Windows Communication Foundation) is a secure, reliable, and scalable messaging platform that can be used to build Web services in . Net. It provides a unified programming model for developing service oriented applications. You can use WCF to build RESTful services in . NET.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With