Lines Matching refs:hostName
69 * Returns true if {@code certificate} matches {@code hostName}.
71 private boolean verifyHostName(String hostName, X509Certificate certificate) {
72 hostName = hostName.toLowerCase(Locale.US);
76 if (verifyHostName(hostName, altName)) {
86 return verifyHostName(hostName, cn);
123 * Returns true if {@code hostName} matches the name or pattern {@code cn}.
125 * @param hostName lowercase host name.
129 public boolean verifyHostName(String hostName, String cn) {
130 if (hostName == null || hostName.isEmpty() || cn == null || cn.isEmpty()) {
137 return hostName.equals(cn);
140 if (cn.startsWith("*.") && hostName.regionMatches(0, cn, 2, cn.length() - 2)) {
150 if (!hostName.regionMatches(0, cn, 0, asterisk)) {
155 int suffixStart = hostName.length() - suffixLength;
156 if (hostName.indexOf('.', asterisk) < suffixStart) {
158 if (!hostName.endsWith(".clients.google.com")) {
163 if (!hostName.regionMatches(suffixStart, cn, asterisk + 1, suffixLength)) {