CertPathBuilderResult cpbr = cpb.build(params);
CertPath cp = cpbr.getCertPath();
if(JiveGlobals.getBooleanProperty("ocsp.enable",false)) {
Log.debug("ClientTrustManager: OCSP requested");
OCSPChecker ocspChecker = new OCSPChecker(cp,params);
params.addCertPathChecker(ocspChecker);
}
PKIXCertPathValidatorResult cpvResult = (PKIXCertPathValidatorResult) cpv.validate(cp, params);
X509Certificate trustedCert = (X509Certificate) cpvResult.getTrustAnchor().getTrustedCert();
if(trustedCert == null) {
throw new CertificateException("certificate path failed: Trusted CA is NULL");