This is an automated email from the ASF dual-hosted git repository.

vy pushed a commit to branch verifyHostName
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit a78766a311c33c18825e709ba32831eaa0daca1a
Author: Volkan Yazıcı <[email protected]>
AuthorDate: Mon Dec 15 10:51:17 2025 +0100

    Improve docs
---
 .../java/org/apache/logging/log4j/core/net/SslSocketManager.java   | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git 
a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/SslSocketManager.java
 
b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/SslSocketManager.java
index 4d8bf1043f..56d283e936 100644
--- 
a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/SslSocketManager.java
+++ 
b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/SslSocketManager.java
@@ -408,14 +408,15 @@ public class SslSocketManager extends TcpSocketManager {
         //
         //     !isIPv4(h) && !isIPv6(h) && isValidHostName(h)
         //
-        // Though we translates this into
+        // Though we translate this into
         //
         //     !h.matches("\d+[.]\d+[.]\d+[.]\d+") && new SNIServerName(h)
         //
         // This simplification is possible because
         //
-        // - The `\d+[.]\d+[.]\d+[.]\d+` regex suffices to eliminate IPv4 
addresses.
-        //   Any sequence of four numeric labels (e.g., `1234.2345.3456.4567`) 
is not a valid host name anyway.
+        // - The `\d+[.]\d+[.]\d+[.]\d+` is sufficient to eliminate IPv4 
addresses.
+        //   Any sequence of four numeric labels (e.g., `1234.2345.3456.4567`) 
is not a valid host name.
+        //   Hence, false positives are not a problem, they would be 
eliminated by `isValidHostName()` anyway.
         //
         // - `SNIServerName::new` throws an exception on invalid host names.
         //   This check is performed using `IDN.toASCII(hostName, 
IDN.USE_STD3_ASCII_RULES)`.

Reply via email to