title: javax.servlet.request.X509Certificate issue with returns null value
body: <p>When I try to run the following code from my Eclipse, I always get the return value as null:</p>
  
  <pre><code>    X509Certificate cert[] = (X509Certificate[]) request.getAttribute("javax.servlet.request.X509Certificate");
  System.out.println("cert: " + cert[0]); //always returns null
  </code></pre>
  
  <p>Could someone assist me with this issue? I read somewhere saying that I have to set the client authentication value to true, but how do I do that? I use pom.xml and web.xml (attached below)</p>
  
  <pre><code>web.xml:
  &lt;security-constraint&gt;
    &lt;web-resource-collection&gt;
      &lt;web-resource-name&gt;HTTPS&lt;web-resource-name&gt;
      &lt;url-pattern&gt;/*&lt;url-pattern&gt;
    &lt;/web-resource-collection&gt;
    &lt;user-data-constraint&gt;
      &lt;transport-guarantee&gt;CONFIDENTIAL&lt;/transport-guarantee&gt;
    &lt;/user-data-constraint&gt;
  &lt;/security-constraint&gt;
  &lt;login-config&gt;
    &lt;auth-method&gt;CLIENT-CERT&lt;/auth-method&gt;
  &lt;/login-config&gt;
  
  pom.xml:
  &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
  &lt;artifactId&gt;tomcat-maven-plugin&lt;/artifactId&gt;
  &lt;configuration&gt;
    &lt;httpsPort&gt;8443&lt;/httpsPort&gt;
    &lt;keystoreFile&gt;${basedir}/certs/keystore.jks&lt;/keystoreFile&gt;
    &lt;keystorePass&gt;changeit&lt;/keystorePass&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Any help is really appreciated!!</p>
  
  <p>Thanks! </p>