diff --git a/Directory.Build.props b/Directory.Build.props index 598c3f06..dee4e925 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -3,7 +3,7 @@ Ugo Lattanzi - 13.0.1 + 13.1.0 @@ -50,6 +50,9 @@ Features: Serializer packages (pick one): System.Text.Json, Newtonsoft, MemoryPack, MsgPack, Protobuf, ServiceStack, Utf8Json. +v13.1.0: +- Added RedisConfiguration.SslHost to set the target host used when validating the SSL certificate (enables SSL mode when set) + v13.0.1: - Performance: connection pool selection no longer allocates multiple ServerCounters snapshots per operation (LeastLoaded) and uses a true lock-free round-robin instead of a cryptographic RNG (RoundRobin) - Performance: RedisDatabase instances are cached per database number instead of being allocated on every Db0..Db16 access diff --git a/src/core/StackExchange.Redis.Extensions.Core/Configuration/RedisConfiguration.cs b/src/core/StackExchange.Redis.Extensions.Core/Configuration/RedisConfiguration.cs index ee7b0008..2155cb42 100644 --- a/src/core/StackExchange.Redis.Extensions.Core/Configuration/RedisConfiguration.cs +++ b/src/core/StackExchange.Redis.Extensions.Core/Configuration/RedisConfiguration.cs @@ -26,6 +26,7 @@ public class RedisConfiguration private string? password; private bool allowAdmin; private bool ssl; + private string? sslHost; private int connectTimeout = 5000; private int syncTimeout = 5000; private bool abortOnConnectFail; @@ -271,6 +272,20 @@ public bool Ssl } } + /// + /// The target-host to use when validating SSL certificate; setting a value here enables SSL mode. + /// + public string? SslHost + { + get => sslHost; + + set + { + sslHost = value; + ResetConfigurationOptions(); + } + } + /// /// Gets or sets the time in milliseconds that should be allowed for connection (defaults to 5 seconds unless SyncTimeout is higher). /// @@ -485,6 +500,7 @@ public ConfigurationOptions ConfigurationOptions newOptions = new() { Ssl = Ssl, + SslHost = SslHost, AllowAdmin = AllowAdmin, Password = Password, ConnectTimeout = ConnectTimeout,