public TrustManager[] getTrustManagers() {
        TrustManager[] origTrustManagers = this.origTmf.getTrustManagers();
        TrustManager[] wrappedTrustManagers = new TrustManager[origTrustManagers.length];
        for (int i = 0; i < origTrustManagers.length; i++) {
            TrustManager tm = origTrustManagers[i];
            if (tm instanceof X509TrustManager) {
                // Wrap only X509 trust managers
                wrappedTrustManagers[i] = new CommonNameLoggingTrustManager((X509TrustManager) tm, 2000);
            } else {
                wrappedTrustManagers[i] = tm;
            }
        }
        return wrappedTrustManagers;
    }
Factory for creating a wrapped trust manager factory
@param kmfAlgorithm the algorithm
@return A wrapped trust manager factory
@throws NoSuchAlgorithmException
clients/src/main/java/org/apache/kafka/common/security/ssl/CommonNameLoggingTrustManagerFactoryWrapper.java