MikeZ
MikeZ

Reputation: 1355

Implement client-specific WCF ServicePointManager ServerCertificateValidationCallback?

ServicePointManager.ServerCertificateValidationCallback allows for custom validation of service-side certificates.

This works fine when there is only one custom validator. But I have multiple clients and I need to be able to specify different validators for each client.

Now, as best I can tell, there is only one ServicePointManager for all ClientBase objects, so, by default, all clients will pass through the same service-side certificate validation chain.

If I have to, I suppose could:

  1. Hook all the validators into the chain and then add logic to each to understand when to validate and when to simply return true

  2. Maintain a collection of validators (ugh!) and invoke appropriately

I'm hoping to avoid both ... is there some extensible component built into WCF that supports multiple ServicePointManagers?

Help! Any suggestions or pointers are welcome!

Upvotes: 1

Views: 1486

Answers (1)

Peter Sladek
Peter Sladek

Reputation: 910

It is possible to have client/channel specific SSL validators. See this answer.

Upvotes: 1

Related Questions