title: How to configure the jboss server to read a client certificate
body: <p>I have a PKCS12 keystore file. I have imported that in my browser. In my code I have to retrieve the certificate info and the data. </p>
  
  <p>Is there any configuration needed to be done in JBOSS EAP 5.1?</p>
  
  <pre><code>    HttpServletRequest req=(HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
      response.setContentType("text/plain");
      PrintWriter out = response.getWriter();
      X509Certificate[] certs = (X509Certificate[]) req.getAttribute("javax.servlet.request.X509Certificate");    
      if (certs != null) {
      for (int i = 0; i &lt; certs.length; i++) {
      out.println("Client Certificate [" + i + "] = " + certs[i].toString());
      }
      }
      else {
      if ("https".equals(request.getScheme())) {
      out.println("This was an HTTPS request, but no client certificate is available");
      }   
  </code></pre>
  
  <p>While running it. Line</p>
  
  <pre><code>X509Certificate[] certs = (X509Certificate[]) req.getAttribute("javax.servlet.request.X509Certificate");    
  </code></pre>
  
  <p>giving null every time.</p>