@Override
    public Optional<Credentials> extract(final CallContext ctx) {
        val certificates = (Optional<X509Certificate[]>) ctx.webContext().getRequestAttribute(headerName);

        if (certificates.isPresent() && certificates.get().length > 0) {
            val certificate = certificates.get()[0];
            LOGGER.debug("X509 certificate: {}", certificate);

            return Optional.of(new X509Credentials(certificate));
        }

        LOGGER.debug("No X509 certificate in request");
        return Optional.empty();
    }
Constant <code>CERTIFICATE_REQUEST_ATTRIBUTE="jakarta.servlet.request.X509Certificate"</code>
pac4j-http/src/main/java/org/pac4j/http/credentials/extractor/X509CredentialsExtractor.java