0

I am unable to out.println or system.out.println the apache JKEnvVar SSL_SESSION_ID and SSL_CLIENT_DN to java code, or javascript. I want to add it to each session in my webapp, then print it to string.

Setup Apache properly with SSL_mods and set the variables to be available from tomcat.

Example of my httpd.conf

<virtual host>
  SSLOptions +StdEnvVars +ExportCertData
  JKMount /*.jsp ajp13
  JKMount /Servlet ajp13`
  JKEnvVar SSL_CLIENT_CERT
  JKEnvVar SSL_CLIENT_DN
  JKEnvVar SSL_CLIENT_V_START

I expect to be able to leverage these variables in my tomcat web application. But I do not know how.

HERE IS WHAT I TRIED: I have tried several ways: I tried making an interface that defined the variables as strings then out printing (request.getAttribute(SSL_CLIENT_DN)); and I have also tried HTTPServletRequest a= (HttpServletRequest) request; javax.servlet.http.HttpSession ahttpsession = a.getSession(); then httpSession.getAttribute(SSL_CLIENT_DN);

These return null value, I also tried: printing headers as Enumeration headerNames=request.getHeaderNames();

This returns this String "SSL_CLIENT_DN". I need the DYNAMIC DATA, the dynamic variable that SSL_CLIENT_DN produces. The clients actual DN as a String.

KayKoder
  • 319
  • 1
  • 8

1 Answers1

0

Okay I figured it out. I did everything right, the problem was the variables were inaccessible because I had to change the folder directory permissions of "/var/www" using chmod 775 -R

KayKoder
  • 319
  • 1
  • 8