Skip to content

Commit

Permalink
Reduced log level of ignored ssl errors. [API-1966] (#846)
Browse files Browse the repository at this point in the history
* 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 <sgay@pilotine.com>

* Update src/Hazelcast.Net/Networking/SslLayer.cs

Co-authored-by: Stephan <sgay@pilotine.com>

---------

Co-authored-by: Stephan <sgay@pilotine.com>
  • Loading branch information
emreyigit and zpqrtbnk authored Jul 11, 2023
1 parent 91827d8 commit cbe2c1a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Hazelcast.Net.Tests/Networking/SslLayerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/Hazelcast.Net/Networking/SslLayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
}

Expand All @@ -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.");
}
}

Expand Down

0 comments on commit cbe2c1a

Please sign in to comment.