Skip to content

Commit b08e05c

Browse files
Merge pull request #2372 from CodersRealm/patch-1
Refactor certificate loading to use helper methods
2 parents e2ef016 + 9cd8421 commit b08e05c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/develop/clients/dotnet/connect.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ ConfigurationOptions options = new ConfigurationOptions
9595

9696
options.CertificateSelection += delegate
9797
{
98-
return new X509Certificate2("redis.pfx", "secret"); // use the password you specified for pfx file
98+
return X509CertificateLoader.LoadPkcs12FromFile("redis.pfx", "secret"); // use the password you specified for pfx file
9999
};
100100
options.CertificateValidation += ValidateServerCertificate;
101101

@@ -109,7 +109,7 @@ bool ValidateServerCertificate(
109109
return false;
110110
}
111111

112-
var ca = new X509Certificate2("redis_ca.pem");
112+
var ca = X509CertificateLoader.LoadCertificateFromFile("redis_ca.pem");
113113
bool verdict = (certificate.Issuer == ca.Subject);
114114
if (verdict) {
115115
return true;

0 commit comments

Comments
 (0)