private static GeneralNames getLocalhostSubjectAltNames() throws UnknownHostException {
    InetAddress[] localAddresses = InetAddress.getAllByName("localhost");
    GeneralName[] generalNames = new GeneralName[localAddresses.length + 1];
    for (int i = 0; i < localAddresses.length; i++) {
      generalNames[i] =
        new GeneralName(GeneralName.iPAddress, new DEROctetString(localAddresses[i].getAddress()));
    }
    generalNames[generalNames.length - 1] =
      new GeneralName(GeneralName.dNSName, new DERIA5String("localhost"));
    return new GeneralNames(generalNames);
  }
Returns subject alternative names for "localhost".
@return the subject alternative names for "localhost".
hbase-common/src/test/java/org/apache/hadoop/hbase/io/crypto/tls/X509TestHelpers.java