Source:
X509TrustManager build() throws NoSuchAlgorithmException, KeyStoreException, ConfigXMLParseException { final String algorithm = this.algorithm != null ? this.algorithm : TrustManagerFactory.getDefaultAlgorithm(); Provider provider = findProvider(providers, providerName, TrustManagerFactory.class, algorithm); if (provider == null) { throw xmlLog.xmlUnableToIdentifyProvider(xmlLocation, providerName, "TrustManagerFactory", algorithm); } final TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(algorithm, provider); if (crl || ocsp) { X509RevocationTrustManager.Builder revocationBuilder = X509RevocationTrustManager.builder(); revocationBuilder.setCrlStream(crlStream); revocationBuilder.setResponderURI(ocspResponder); revocationBuilder.setTrustManagerFactory(trustManagerFactory); revocationBuilder.setTrustStore(trustStore); revocationBuilder.setOnlyEndEntity(onlyLeafCert); revocationBuilder.setSoftFail(softFail); if (crl && ocsp) { revocationBuilder.setPreferCrls(preferCrls); } else if (crl) { revocationBuilder.setPreferCrls(true); revocationBuilder.setNoFallback(true); } else { revocationBuilder.setPreferCrls(false); revocationBuilder.setNoFallback(true); } revocationBuilder.setNoFallback(false); return revocationBuilder.build(); } else { trustManagerFactory.init(trustStore); } for (TrustManager trustManager : trustManagerFactory.getTrustManagers()) { if (trustManager instanceof X509TrustManager) { return (X509TrustManager) trustManager; } } throw ElytronMessages.log.noDefaultTrustManager(); }

Target:
X509TrustManager build() throws NoSuchAlgorithmException, KeyStoreException, ConfigXMLParseException { final String algorithm = this.algorithm != null ? this.algorithm : TrustManagerFactory.getDefaultAlgorithm(); Provider provider = findProvider(providers, providerName, TrustManagerFactory.class, algorithm); if (provider == null) { throw xmlLog.xmlUnableToIdentifyProvider(xmlLocation, providerName, "TrustManagerFactory", algorithm); } final TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(algorithm, provider); if (crl || ocsp) { X509RevocationTrustManager.Builder revocationBuilder = X509RevocationTrustManager.builder(); revocationBuilder.setCrlStream(crlStream); revocationBuilder.setResponderURI(ocspResponder); revocationBuilder.setTrustManagerFactory(trustManagerFactory); revocationBuilder.setTrustStore(trustStore); revocationBuilder.setOnlyEndEntity(onlyLeafCert); revocationBuilder.setSoftFail(softFail); if (crl && ocsp) { revocationBuilder.setPreferCrls(preferCrls); revocationBuilder.setNoFallback(false); } else if (crl) { revocationBuilder.setPreferCrls(true); revocationBuilder.setNoFallback(true); } else { revocationBuilder.setPreferCrls(false); revocationBuilder.setNoFallback(true); } if (responderCertAlias != null) { KeyStore responderStore = responderStoreSupplier != null ? responderStoreSupplier.get() : trustStore; revocationBuilder.setOcspResponderCert((X509Certificate) responderStore.getCertificate(responderCertAlias)); } return revocationBuilder.build(); } else { trustManagerFactory.init(trustStore); } for (TrustManager trustManager : trustManagerFactory.getTrustManagers()) { if (trustManager instanceof X509TrustManager) { return (X509TrustManager) trustManager; } } throw ElytronMessages.log.noDefaultTrustManager(); }