private static String sanitizeCertificateBody(final String certHeaderValue) {
        var body = certHeaderValue.substring(X509_HEADER.length(), certHeaderValue.length() - X509_FOOTER.length());
        body = body.replace(' ', '\n');
        body = body.replace('\t', '\n');
        return X509_HEADER.concat("\n").concat(body).concat("\n").concat(X509_FOOTER).concat("\n");
    }
Get certificate from header or return null.
HTTPD mod_header writes "(null)" when the ssl variable is not filled
so that is treated as if the header were not present or blank.

@param request HTTP request object
@return Base64 encoded certificate
support/cas-server-support-x509-core/src/main/java/org/apereo/cas/adaptors/x509/authentication/RequestHeaderX509CertificateExtractor.java