Skip to content

Commit 7a9208f

Browse files
committed
- release notes
- use Enum.TryParse for the X509 flags
1 parent 9d5240e commit 7a9208f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

docs/ReleaseNotes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Current package versions:
99
## Unreleased
1010
No pending unreleased changes
1111

12+
- Add `ConfigurationOptions.SetUserPemCertificate(...)` and `ConfigurationOptions.SetUserPfxCertificate(...)` methods to simplify using client certificates ([#2873 by mgravell](https://github.com/StackExchange/StackExchange.Redis/pull/2873))
13+
1214
## 2.8.31
1315

1416
- Fix: Respect `IReconnectRetryPolicy` timing in the case that a node that was present disconnects indefinitely ([#2853](https://github.com/StackExchange/StackExchange.Redis/pull/2853) & [#2856](https://github.com/StackExchange/StackExchange.Redis/pull/2856) by NickCraver)

src/StackExchange.Redis/PhysicalConnection.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,10 +1510,9 @@ public ConnectionStatus GetStatus()
15101510
var password = Environment.GetEnvironmentVariable("SERedis_ClientCertPassword");
15111511
var pfxStorageFlags = Environment.GetEnvironmentVariable("SERedis_ClientCertStorageFlags");
15121512
X509KeyStorageFlags storageFlags = X509KeyStorageFlags.DefaultKeySet;
1513-
if (!string.IsNullOrEmpty(pfxStorageFlags))
1513+
if (!string.IsNullOrEmpty(pfxStorageFlags) && Enum.TryParse<X509KeyStorageFlags>(pfxStorageFlags, true, out var typedFlags))
15141514
{
1515-
var tmp = Enum.Parse(typeof(X509KeyStorageFlags), pfxStorageFlags) as X509KeyStorageFlags?;
1516-
if (tmp is not null) storageFlags = tmp.GetValueOrDefault();
1515+
storageFlags = typedFlags;
15171516
}
15181517

15191518
return ConfigurationOptions.CreatePfxUserCertificateCallback(certificatePath, password, storageFlags);

0 commit comments

Comments
 (0)