-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4013cb3
commit 56c2cea
Showing
3 changed files
with
23 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#nullable enable | ||
|
||
namespace ServiceControl.RavenDB; | ||
|
||
using System.Reflection; | ||
using System.Security.Cryptography.X509Certificates; | ||
|
||
public static class RavenClientCertificate | ||
{ | ||
public static X509Certificate2? FindClientCertificate() | ||
{ | ||
var applicationDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location) ?? string.Empty; | ||
var certificatePath = Path.Combine(applicationDirectory, "raven-client-certificate.pfx"); | ||
|
||
if (File.Exists(certificatePath)) | ||
{ | ||
return new X509Certificate2(certificatePath); | ||
} | ||
return null; | ||
} | ||
} |