From d7dd7341094da7ed3bbeb37dbcf22d4e5c446e3c Mon Sep 17 00:00:00 2001 From: David Boike Date: Fri, 31 Jan 2025 16:02:31 -0600 Subject: [PATCH] Changes from review --- .../ServerConfiguration.cs | 6 +++--- src/ServiceControl.RavenDB/RavenClientCertificate.cs | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ServiceControl.Audit.Persistence.RavenDB/ServerConfiguration.cs b/src/ServiceControl.Audit.Persistence.RavenDB/ServerConfiguration.cs index ef4255849a..53c3199f31 100644 --- a/src/ServiceControl.Audit.Persistence.RavenDB/ServerConfiguration.cs +++ b/src/ServiceControl.Audit.Persistence.RavenDB/ServerConfiguration.cs @@ -20,9 +20,9 @@ public ServerConfiguration(string dbPath, string serverUrl, string logPath, stri } public string ConnectionString { get; } - public string ClientCertificatePath { get; internal set; } - public string ClientCertificateBase64 { get; internal set; } - public string ClientCertificatePassword { get; internal set; } + public string ClientCertificatePath { get; set; } + public string ClientCertificateBase64 { get; set; } + public string ClientCertificatePassword { get; set; } public bool UseEmbeddedServer { get; } public string DbPath { get; internal set; } //Setter for ATT only public string ServerUrl { get; } diff --git a/src/ServiceControl.RavenDB/RavenClientCertificate.cs b/src/ServiceControl.RavenDB/RavenClientCertificate.cs index 41f142f39e..0c6bc2dbb8 100644 --- a/src/ServiceControl.RavenDB/RavenClientCertificate.cs +++ b/src/ServiceControl.RavenDB/RavenClientCertificate.cs @@ -25,6 +25,10 @@ public static class RavenClientCertificate if (certInfo.ClientCertificatePath is not null) { + if (!File.Exists(certInfo.ClientCertificatePath)) + { + throw new Exception("Could not read the RavenDB client certificate from the supplied path because no file was found."); + } return new X509Certificate2(certInfo.ClientCertificatePath, certInfo.ClientCertificatePassword); }