Class Hostnames

java.lang.Object
nl.altindag.ssl.hostnameverifier.Hostnames

final class Hostnames extends Object
This HostnameVerifier is copied from OkHttp library, see here for the original content: - https://github.com/square/okhttp/blob/69ae7f3e10dae0554f3181edaa52bcd77ee448ab/okhttp/src/jvmMain/kotlin/okhttp3/internal/-HostnamesJvm.kt#L1
  • Constructor Details

    • Hostnames

      private Hostnames()
  • Method Details

    • toCanonicalHost

      static String toCanonicalHost(String host)
      If this is an IP address, this returns the IP address in canonical form.

      Otherwise this performs IDN ToASCII encoding and canonicalize the result to lowercase. For example this converts `☃.net` to `xn--n3h.net`, and `WwW.GoOgLe.cOm` to `www.google.com`. `null` will be returned if the host cannot be ToASCII encoded or if the result contains unsupported ASCII characters.