Class IPUtility


  • public class IPUtility
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      IPUtility()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isInetAddress​(java.lang.String ipString)  
      static java.lang.String stripTrailingDot​(java.lang.String host)
      Remove the DNS root label marker from a hostname.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IPUtility

        public IPUtility()
    • Method Detail

      • isInetAddress

        public static boolean isInetAddress​(java.lang.String ipString)
      • stripTrailingDot

        public static java.lang.String stripTrailingDot​(java.lang.String host)
        Remove the DNS root label marker from a hostname. A trailing dot marks a name as absolute for resolution only: it must be kept for DNS resolution, but removed for every TLS use of the name. RFC 6066 section 3 prohibits it in SNI, and certificates never carry it, so an IP literal written as 10.0.0.1. must be normalized before being recognized as an IP.
        Parameters:
        host - hostname, may be null
        Returns:
        hostname without any trailing dot