title: Retrieve client cert in Servlet when using mutual authentication?
body: <p>I am building a web application using Java and Tomcat 7.0.</p>
  
  <p>I have a self-signed certificate (in the future I'll get an official one) on the server side, and I've added a client's root certificate to its truststore. I've already set a required two-way authentication for https protocol on port 3443 with the following lines on the server.xml file:</p>
  
  <pre><code>&lt;Connector port="3443" scheme="https" secure="true" SSLEnabled="true" 
          truststoreFile="server.keystore" truststorePass="keystore password" 
          keystoreFile="server.keystore" keystorePass="keystore password" 
          clientAuth="true" keyAlias="serverkey" 
          sslProtocol="TLS"/&gt;
  </code></pre>
  
  <p>This is working and I can only access the system with a valid certificate.</p>
  
  <p>I was now wondering how I can get a property of this used certificate on my Servlet to log the user in based on his certificate. All certificates used in this context will have a different CN so I want to use that to identify the user.</p>