Skip to content

RedisConfiguration is Missing the CertificateSelection Event Declaration #613

@CodersRealm

Description

@CodersRealm

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.

  1. In the RedisConfiguration class, 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;
  1. Further down, in the ConfigurationOptions getter, 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions