List of usage examples for org.apache.commons.ssl Certificates getDNSSubjectAlts
public static String[] getDNSSubjectAlts(X509Certificate cert)
From source file:org.opensaml.xml.security.x509.tls.StrictHostnameVerifier.java
/** {@inheritDoc} */ public void check(String[] host, X509Certificate cert) throws SSLException { String[] cns = X509Util.getCommonNames(cert.getSubjectX500Principal()).toArray(new String[0]); String[] subjectAlts = Certificates.getDNSSubjectAlts(cert); //Note: could use X509Util for subject alt names also, per below. //List<String> subjectAltsList = X509Util.getAltNames(cert, new Integer[]{X509Util.DNS_ALT_NAME}); //String[] subjectAlts = subjectAltsList.toArray(new String[0]); check(host, cns, subjectAlts);//www . j a va 2s .c om }