Our .NET application currently uses RestSharp v106 and Ninject. It uses client certificates to authenticate the user with a secured server. The user starts the application, selects one of the certificates installed in their Windows certificate store and unlocks it via their user password or other methods. At this point, the DI container has already created our RestSharp.RestClient
instance.
Before restharp v107, we would use RestSharpClient.ClientCertificates
to add or replace previously used certificates with the user selected certificate via an Authenticator
-implementation. From v107 onwards, ClientCertificates
is part of RestClientOptions
and can only be set when instantiating a new RestSharp.RestClient
.
We’re currently thinking about implementing a factory similar to the simple factory – instead of base urls we would use certificate identifiers as Dictionary keys.
Are there an alternative way to set the certificate after instantiating the RestClient
or is this factory a viable option?