private Optional<String> extractDNFromRequest(final HttpServletRequest request,
                                                  final ReceiveDataConfig receiveDataConfig,
                                                  final boolean isRemoteHostTrusted) {
        final String x509CertificateDnHeader = receiveDataConfig.getX509CertificateDnHeader();
        final String clientDn = request.getHeader(x509CertificateDnHeader);
        LOGGER.debug(() -> x509CertificateDnHeader + " = " + clientDn);
        Optional<String> optDn = NullSafe.isNonBlankString(clientDn)
                ? Optional.of(clientDn)
                : Optional.empty();

        if (optDn.isPresent() && !isRemoteHostTrusted) {
            logUntrustedHostWarning(request, receiveDataConfig, x509CertificateDnHeader);
            optDn = Optional.empty();
        }
        return optDn;
    }
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