From cbe2c1a31106ba08d82a0d219ad3ac2e9adf5c52 Mon Sep 17 00:00:00 2001 From: Emre Yigit Date: Tue, 11 Jul 2023 13:06:47 +0300 Subject: [PATCH] Reduced log level of ignored ssl errors. [API-1966] (#846) * Reduced log level of ignored ssl errors. * Fix the tests according to log level change. * Fix log level to catch message. * Update src/Hazelcast.Net/Networking/SslLayer.cs Co-authored-by: Stephan * Update src/Hazelcast.Net/Networking/SslLayer.cs Co-authored-by: Stephan --------- Co-authored-by: Stephan --- src/Hazelcast.Net.Tests/Networking/SslLayerTests.cs | 2 +- src/Hazelcast.Net/Networking/SslLayer.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Hazelcast.Net.Tests/Networking/SslLayerTests.cs b/src/Hazelcast.Net.Tests/Networking/SslLayerTests.cs index e5bfc68c0..5a97fef2e 100644 --- a/src/Hazelcast.Net.Tests/Networking/SslLayerTests.cs +++ b/src/Hazelcast.Net.Tests/Networking/SslLayerTests.cs @@ -72,7 +72,7 @@ public void TestGetTargetHostname() public void ValidateCertificate() { var text = new StringBuilder(); - var loggerFactory = LoggerFactory.Create(builder => builder.AddStringBuilder(text)); + var loggerFactory = LoggerFactory.Create(builder => builder.SetMinimumLevel(LogLevel.Debug).AddStringBuilder(text)); var sender = new object(); #pragma warning disable SYSLIB0026 // X509Certificate empty constructor is obsolete BUT here we DO want to use it to create an empty cert diff --git a/src/Hazelcast.Net/Networking/SslLayer.cs b/src/Hazelcast.Net/Networking/SslLayer.cs index efd66b355..05b3af709 100644 --- a/src/Hazelcast.Net/Networking/SslLayer.cs +++ b/src/Hazelcast.Net/Networking/SslLayer.cs @@ -197,7 +197,7 @@ internal bool ValidateCertificate(object sender, X509Certificate cert, X509Chain } else { - _logger.LogInformation("SSL certificate errors (chain validation) ignored by client configuration."); + _logger.IfDebug()?.LogDebug("SSL certificate errors (chain validation) ignored by client configuration."); } } @@ -216,7 +216,7 @@ internal bool ValidateCertificate(object sender, X509Certificate cert, X509Chain } else { - _logger.LogInformation("SSL certificate errors (name validation) ignored by client configuration."); + _logger.IfDebug()?.LogDebug("SSL certificate errors (name validation) ignored by client configuration."); } }