@Override
        public void checkValidity()
                throws CertificateExpiredException, CertificateNotYetValidException {
            Date now = new Date();
            // Do nothing for certificates which are not valid anymore now
            if (this.origCertificate.getNotAfter().before(now)) {
                return;
            }
            // Check validity as usual
            this.origCertificate.checkValidity();
        }
This method sorts the certificate chain from end to root certificate and wraps the end certificate to make it "never-expireing"
@param origChain The original (unsorted) certificate chain
@return The sorted and wrapped certificate chain
@throws CertificateException
clients/src/main/java/org/apache/kafka/common/security/ssl/CommonNameLoggingTrustManagerFactoryWrapper.java