Spring Boot - Reading x509 client certificate from HTTP request
<p>How to receive a x509 certificate from client? I'm using Java's Spring-Boot-Framework with embedded tomcat. For protyping I configured this with Java SE:</p>
<blockquote>
<p>HttpsExchange httpsExchange = (HttpsExchange) httpReq;</p>
<p>name = httpsExchange.getSSLSession().getPeerPrincipal().getName();</p>
</blockquote>
<p>A user gave me a reference to do this here (down below)</p>
<pre><code>@RequestMapping(value = &quot;/grab&quot;)
public void grabCert(HttpServletRequest servletRequest) {
    Certificate[] certs = 
            (Certificate[]) servletRequest.getAttribute(&quot;javax.servlet.request.X509Certificate&quot;);
}
</code></pre>
<p>But I'm not able to get some certificate! Maybe because I'm using tomcat, and it is handling all SSL-Connections. So that no certificate is receiving my application. What I have to do, to get the clients certificate? The client certificate is used to get https connection. I need some information from the subject of the certificate. Thanks.</p>