Home / Function/ isValidHostNameForSNI() — netty Function Reference

isValidHostNameForSNI() — netty Function Reference

Architecture documentation for the isValidHostNameForSNI() function in SslUtils.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  20fd515b_7590_36d6_ca07_9a75741e8aaa["isValidHostNameForSNI()"]
  8b8e2625_56a3_eef0_1cb3_fa21bb9b476e["SslUtils"]
  20fd515b_7590_36d6_ca07_9a75741e8aaa -->|defined in| 8b8e2625_56a3_eef0_1cb3_fa21bb9b476e
  style 20fd515b_7590_36d6_ca07_9a75741e8aaa fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/main/java/io/netty/handler/ssl/SslUtils.java lines 580–589

    static boolean isValidHostNameForSNI(String hostname) {
        // See  https://datatracker.ietf.org/doc/html/rfc6066#section-3
        return hostname != null &&
                // SNI HostName has to be a FQDN according to TLS SNI Extension spec (see [1]),
                // which means that is has to have at least a host name and a domain part.
                hostname.indexOf('.') > 0 &&
                !hostname.endsWith(".") && !hostname.startsWith("/") &&
                !NetUtil.isValidIpV4Address(hostname) &&
                !NetUtil.isValidIpV6Address(hostname);
    }

Domain

Subdomains

Frequently Asked Questions

What does isValidHostNameForSNI() do?
isValidHostNameForSNI() is a function in the netty codebase, defined in handler/src/main/java/io/netty/handler/ssl/SslUtils.java.
Where is isValidHostNameForSNI() defined?
isValidHostNameForSNI() is defined in handler/src/main/java/io/netty/handler/ssl/SslUtils.java at line 580.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free