private static Optional<X509Certificate> extractCertificate(final ServletRequest request,
                                                                final String attributeName) {
        final Object[] certs = (Object[]) request.getAttribute(attributeName);
        return Optional.ofNullable(certs)
                .flatMap(certs2 -> {
                    LOGGER.debug(() -> "Found certificate using " + attributeName + " header");
                    return extractCertificate(certs);
                });
    }
Pull out the Subject from the certificate. E.g.
"CN=some.server.co.uk, OU=servers, O=some organisation, C=GB"
stroom-receive/stroom-receive-common/src/main/java/stroom/receive/common/CertificateExtractorImpl.java