I have a WCF service that works with two endpoints: HTTP and https. I need to add another https endpoint so that one would require Client certificate and another one wouldn't.
If I add new https endpoint with its own base address I get the error:
System.ArgumentException: This collection already contains an address with scheme https. There can be at most one address per scheme in this collection. If your service is being hosted in IIS you can fix the problem by setting 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' to true or specifying 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'.
I tried adding
<serviceHostingEnvironment multipleSiteBindingsEnabled="true">
</serviceHostingEnvironment>
but it didn't help - getting the same error.
If I add new https endpoint using the same Listen Uri but different binding configuration then I get the error:
System.InvalidOperationException: A binding instance has already been associated to listen URI 'https://localhost:9907/myservice/myservice'. If two endpoints want to share the same ListenUri, they must also share the same binding object instance.
But I need two different bindings - one with Client certificate requirement and one without.
Is it feasible?
Thank you