File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/ServiceControl.RavenDB Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ public static class RavenClientCertificate
1515 try
1616 {
1717 var bytes = Convert . FromBase64String ( certInfo . ClientCertificateBase64 ) ;
18- return new X509Certificate2 ( bytes , certInfo . ClientCertificatePassword ) ;
18+ return X509CertificateLoader . LoadPkcs12 ( bytes , certInfo . ClientCertificatePassword ) ;
1919 }
2020 catch ( Exception x ) when ( x is FormatException or CryptographicException )
2121 {
@@ -29,15 +29,15 @@ public static class RavenClientCertificate
2929 {
3030 throw new Exception ( "Could not read the RavenDB client certificate from the supplied path because no file was found." ) ;
3131 }
32- return new X509Certificate2 ( certInfo . ClientCertificatePath , certInfo . ClientCertificatePassword ) ;
32+ return X509CertificateLoader . LoadPkcs12FromFile ( certInfo . ClientCertificatePath , certInfo . ClientCertificatePassword ) ;
3333 }
3434
3535 var applicationDirectory = Path . GetDirectoryName ( Assembly . GetEntryAssembly ( ) ? . Location ) ?? string . Empty ;
3636 var certificatePath = Path . Combine ( applicationDirectory , "raven-client-certificate.pfx" ) ;
3737
3838 if ( File . Exists ( certificatePath ) )
3939 {
40- return new X509Certificate2 ( certificatePath , certInfo . ClientCertificatePassword ) ;
40+ return X509CertificateLoader . LoadPkcs12FromFile ( certificatePath , certInfo . ClientCertificatePassword ) ;
4141 }
4242 return null ;
4343 }
You can’t perform that action at this time.
0 commit comments