Skip to content

Commit d7afff7

Browse files
Merge branch 'initial_AB#64146' of https://github.com/Keyfactor/nexus-certificate-manager-caplugin into initial_AB#64146
2 parents a6ad3c4 + ad20419 commit d7afff7

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

nexus-certificate-manager-caplugin/NexusCertManagerCAPlugin.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -391,11 +391,12 @@ public async Task ValidateCAConnectionInfo(Dictionary<string, object> connection
391391
var certPassword = (string)connectionInfo[Constants.AUTHCERTPASSWORD];
392392

393393
// validate that it works
394-
var clientCertificate = new X509Certificate2(certPath, certPassword);
395-
396-
var pub = clientCertificate.GetPublicKey();
397-
var pubString = Convert.ToBase64String(pub);
398-
_logger.LogTrace($"was able to successfully read the cert with the provided password. public key: {pubString}");
394+
using (var clientCertificate = new X509Certificate2(certPath, certPassword))
395+
{
396+
var pub = clientCertificate.GetPublicKey();
397+
var pubString = Convert.ToBase64String(pub);
398+
_logger.LogTrace($"was able to successfully read the cert with the provided password. public key: {pubString}");
399+
}
399400
}
400401
catch (Exception ex)
401402
{

0 commit comments

Comments
 (0)