Using Indexing Service With Both HTTP and HTTPS

In my previous article I showed how to modify Indexing Service when SSL is used, but in some cases you might want to use Indexing Service simultaneously with SSL and without it. Example if you allow users to access EPiServer back-end with HTTP and HTTPS protocols or your environments (local, test, staging, production) use different protocols but you want to minimize the modifications and ease the deployment between environments. WCF Service binding doesn't have option to bind both HTTP and HTTPS protocols which would be practical. Instead it allows multiple bindings to single endpoint. So we need to add new binding into web.config file and connect that binding to the service endpoint which are defined in EPiServer's own dll. Thanks to EPiServer they have left IndexingServiceHostFactory open for extensions and we can use that for endpoint modifications. Modifications to Web.config
  • IndexingServiceCustomBinding
    • This is the original binding. Leave that as it is.
  • IndexingServiceCustomBindingSecure
    • Add this binding for supporting HTTPS connections
indexingservice web.config IndexingService.svc requires similar modifications for endpoints and if you wan't HTTPS endpoint to be optional you should add small Linq script to check if there is any HTTPS connections allowed. IndexingService Now your indexing service works in both URLs:
  • http://www.mysite.com/IndexingService/IndexingService.svc
  • https://www.mysite.com/IndexingService/IndexingService.svc
In my previous article I showed how to modify Indexing Service when SSL is used, but in some cases y…