Class ServerName


  • public final class ServerName
    extends java.lang.Object
    RFC 6066 3. Server Name Indication Current implementation uses this guidance: "For backward compatibility, all future data structures associated with new NameTypes MUST begin with a 16-bit length field. TLS MAY treat provided server names as opaque data and pass the names and types to the application." RFC 6066 specifies ASCII encoding for host_name (possibly using A-labels for IDNs), but note that the previous version (RFC 4366) specified UTF-8 encoding (see RFC 6066 Appendix A). For maximum compatibility, it is recommended that client code tolerate receiving UTF-8 from the peer, but only generate ASCII itself.
    • Constructor Detail

      • ServerName

        public ServerName​(short nameType,
                          java.lang.Object name)
        Deprecated.
      • ServerName

        public ServerName​(short nameType,
                          byte[] nameData)
    • Method Detail

      • getNameType

        public short getNameType()
      • getNameData

        public byte[] getNameData()
      • getHostName

        public java.lang.String getHostName()
        Deprecated.
        Use getNameData() instead.
        A convenience method for returning a host_name as a UTF-8 string. Note that this method does not attempt to recognize Internationalized Domain Names (see RFC 5890); further processing may be required to support them.
      • encode

        public void encode​(java.io.OutputStream output)
                    throws java.io.IOException
        Encode this ServerName to an OutputStream.
        Parameters:
        output - the OutputStream to encode to.
        Throws:
        java.io.IOException
      • parse

        public static ServerName parse​(java.io.InputStream input)
                                throws java.io.IOException
        Parse a ServerName from an InputStream.
        Parameters:
        input - the InputStream to parse from.
        Returns:
        a ServerName object.
        Throws:
        java.io.IOException