Home | History | Annotate | Download | only in conscrypt

Lines Matching refs:hostName

65      * Given a hostname and a certificate chain this verifies that the chain includes
71 public boolean chainIsNotPinned(String hostname, List<X509Certificate> chain)
74 PinListEntry entry = lookup(hostname);
125 private synchronized PinListEntry lookup(String hostname) throws PinManagerException {
137 // if so, check the hostname cache
138 String cn = hostnameCache.get(hostname);
145 cn = getMatchingCN(hostname);
147 hostnameCache.put(hostname, cn);
152 // if we got here, we don't have a matching CN for this hostname
160 private String getMatchingCN(String hostname) {
168 if (isHostnameMatchedBy(hostname, cn)) {
176 * Returns true if {@code hostName} matches the name or pattern {@code cn}.
178 * @param hostName lowercase host name.
182 private static boolean isHostnameMatchedBy(String hostName, String cn) {
183 if (hostName == null || hostName.isEmpty() || cn == null || cn.isEmpty()) {
190 return hostName.equals(cn);
193 if (cn.startsWith("*.") && hostName.regionMatches(0, cn, 2, cn.length() - 2)) {
204 if (!hostName.regionMatches(0, cn, 0, asterisk)) {
209 int suffixStart = hostName.length() - suffixLength;
210 if (hostName.indexOf('.', asterisk) < suffixStart) {
214 if (!hostName.regionMatches(suffixStart, cn, asterisk + 1, suffixLength)) {