Falcon Momot
Falcon Momot

Reputation: 1135

Get client certificate DN in tomcat

I am writing a servlet for use in Tomcat 7, with APR and OpenSSL, which uses client certificate authentication.

While processing some request, how can I get the DN of the client that made the request?

Since in theory the servlet should be able to run in any container, is there an abstract method for it? In this particular case it is also OK if the method is tomcat/APR/openssl specific.

Upvotes: 1

Views: 460

Answers (1)

Mark Thomas
Mark Thomas

Reputation: 16635

You really need to read the Servlet specification, particularly section 3.9

You want the ServletRequest attribute named javax.servlet.request.X509Certificate

Upvotes: 3

Related Questions