/** * Verify if the hostname is an IP address using {@link LdapUtils#isIPAddress(String)}. Delegates to {@link * #verifyIP(String, X509Certificate)} and {@link #verifyDNS(String, X509Certificate)} accordingly. * * @param hostname to verify * @param cert to verify hostname against * * @return whether hostname is valid for the supplied certificate */ @Override public boolean verify(final String hostname, final X509Certificate cert) { logger.debug("verifying hostname={} against cert={}", hostname, cert.getSubjectX500Principal()); boolean b; if (LdapUtils.isIPAddress(hostname)) { b = verifyIP(hostname, cert); } else { b = verifyDNS(hostname, cert); } return b; }
/** * Verify if the hostname is an IP address using {@link LdapUtils#isIPAddress(String)}. Delegates to {@link * #verifyIP(String, X509Certificate)} and {@link #verifyDNS(String, X509Certificate)} accordingly. * * @param hostname to verify * @param cert to verify hostname against * * @return whether hostname is valid for the supplied certificate */ @Override public boolean verify(final String hostname, final X509Certificate cert) { logger.debug("verifying hostname={} against cert={}", hostname, cert.getSubjectX500Principal()); final boolean b; if (LdapUtils.isIPAddress(hostname)) { b = verifyIP(hostname, cert); } else { b = verifyDNS(hostname, cert); } return b; }
/** * Verify if the hostname is an IP address using {@link LdapUtils#isIPAddress(String)}. Delegates to {@link * #verifyIP(String, X509Certificate)} and {@link #verifyDNS(String, X509Certificate)} accordingly. * * @param hostname to verify * @param cert to verify hostname against * * @return whether hostname is valid for the supplied certificate */ @Override public boolean verify(final String hostname, final X509Certificate cert) { logger.debug("verifying hostname={} against cert={}", hostname, cert.getSubjectX500Principal()); final boolean b; if (LdapUtils.isIPAddress(hostname)) { b = verifyIP(hostname, cert); } else { b = verifyDNS(hostname, cert); } return b; }