-
-
Notifications
You must be signed in to change notification settings - Fork 179
Description
Is your feature request related to a problem? Please describe.
I am testing with self-signed certificates and noticed that RedisConfiguration does not include the CertifcateSelection event. Yet this event is part of StackExchange.Redis and is required for validating self-signed certificates.
On: https://redis.io/docs/latest/develop/clients/dotnet/connect/
Under the section: 'Connect to your production Redis with TLS', there is an example of how to use the CertificateSelection event in conjunction with ValidateServerCertificate.
Describe the solution you'd like
Two additions are needed.
- In the
RedisConfigurationclass, after the private fields, add the following:
/// <summary>
/// A LocalCertificateSelectionCallback delegate responsible for selecting the certificate used for authentication; note
/// that this cannot be specified in the configuration-string.
/// </summary>
public event LocalCertificateSelectionCallback? CertificateSelection;
- Further down, in the
ConfigurationOptionsgetter, add the following:
newOptions.CertificateSelection += CertificateSelection;
Describe alternatives you've considered
It should be possible to add a self-signed certificate ca to the Trusted Root Certification Authorities, but I've not been able to get it to work this way.
Additional context
I've created a fork, implemented these changes, built the packages, and they test okay. I've been using without issue. I can do a PR if you want.