X509Certificate[] () { Set<X509Certificate> certificates = new HashSet<>(); for (X509TrustManager manager : mySystemManagers) { try { certificates.addAll(Arrays.asList(manager.getAcceptedIssuers())); } catch (Throwable exception) { LOG.error("Could not get list of accepted issuers (trusted root identities) from " + manager.toString() + " (" + manager.getClass().getName() + ")", exception); } } certificates.addAll(Arrays.asList(myCustomManager.getAcceptedIssuers())); return certificates.toArray(X509Certificate[]::new); }