private Optional<X509Certificate> extractCertificate(final ServletRequest request,
                                                         final ReceiveDataConfig receiveDataConfig,
                                                         final boolean isRemoteHostTrusted) {
        final String x509CertificateHeader = receiveDataConfig.getX509CertificateHeader();
        Optional<X509Certificate> optCert;
        // First try and get a cert placed in the header by the load balancer (if trusted)
        optCert = extractCertificate(request, x509CertificateHeader);
        if (!isRemoteHostTrusted && optCert.isPresent()) {
            logUntrustedHostWarning(request, receiveDataConfig, x509CertificateHeader);
            optCert = Optional.empty();
        }
        // Fall back to one placed there by the servlet container, i.e. DropWiz does the termination
        return optCert
                .or(() -> extractCertificate(request, SERVLET_CERT_ARG));
    }
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