Skip to content

Commit

Permalink
do not check if file exists
Browse files Browse the repository at this point in the history
  • Loading branch information
rido-min committed Sep 23, 2023
1 parent e9a200d commit 68ca3be
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ internal static bool Handle(MqttClientCertificateValidationEventArgs cvArgs)
if (cvArgs.SslPolicyErrors == System.Net.Security.SslPolicyErrors.RemoteCertificateChainErrors)
{
string caFile = cvArgs.ClientOptions.TlsOptions.CaFile;
if (!string.IsNullOrEmpty(caFile) && File.Exists(caFile))
if (!string.IsNullOrEmpty(caFile))
{
X509Certificate2Collection caCerts = new X509Certificate2Collection();
#if NET6_0_OR_GREATER
Original file line number Diff line number Diff line change
@@ -144,8 +144,8 @@ public MqttClientTlsOptionsBuilder WithCaFile(string caFile)
{
throw new InvalidOperationException("WithCaFile cannot be used with a custom Certificate Validation Handler");
}
WithCertificateValidationHandler(MqttClientCaFileCertificateValidationHandler.Handle);
_tlsOptions.CaFile = caFile;
WithCertificateValidationHandler(MqttClientCaFileCertificateValidationHandler.Handle);
return this;
}
#endif

0 comments on commit 68ca3be

Please sign in to comment.