code: public static void verifyAndThrow(final Set<String> nameSet, final X509Certificate cert) throws CertificateException{
  		if (!verify(nameSet, cert)) {
  			throw new CertificateException("No name matching " + nameSet + " found");
  		}
  	}
docs: Perform server identify check using given names and throw CertificateException if the check fails.
  
  @param nameSet - a set of names from the config file
  @param cert - the server certificate
  @throws CertificateException - throws CertificateException if none of the name in the nameSet matches the names in the cert