Skip to content

Commit

Permalink
dispose X509Store
Browse files Browse the repository at this point in the history
Signed-off-by: Nickolay Batov <[email protected]>
  • Loading branch information
stilettk committed Sep 17, 2023
1 parent 143f619 commit 3b99ed2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/MySqlConnector/Core/ServerSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1291,7 +1291,7 @@ private async Task InitSslAsync(ProtocolCapabilities serverCapabilities, Connect
try
{
var storeLocation = (cs.CertificateStoreLocation == MySqlCertificateStoreLocation.CurrentUser) ? StoreLocation.CurrentUser : StoreLocation.LocalMachine;
var store = new X509Store(StoreName.My, storeLocation);
using var store = new X509Store(StoreName.My, storeLocation);
store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly);

if (cs.CertificateThumbprint.Length == 0)
Expand Down

0 comments on commit 3b99ed2

Please sign in to comment.