I wanted to secure an application I developed recently, and I following mkyong's tutorial.
It worked only for tomcat manager's pages.
Indeed, I use the <transport-guarantee>CONFIDENTIAL</transport-guarantee>
with <auth-method>CLIENT-CERT</auth-method>
.
At the beginning, I wasn't sure about mkyong's certificate, so I followed instructions in maximporges.
I keep getting error code 401.
When I change auth-method from CLIENT-CERT to BASIC, I am prompted to enter login and password, I enter a user's credentials that exists in tomcat-users.xml, and it works.
I tried to add a user in tomcat-users.xml like <user username="CN=xxxx xxx xxx, O=knmi, O=users, O=dutchgrid" password="null" roles="abc" />
I duplicate the exact same information entered previously for the certificate, but doesn't work.
I think the server can't find the client's certificate
Note: I had to change protocol="HTTP/1.1"
to protocol="org.apache.coyote.http11.Http11AprProtocol"
in server.xml to avoid getting ERR_BAD_SSL_CLIENT_AUTH_CERT
.