I want to use hashed passwords in tomcat-users.xml with BASIC authentication. I added digest="SHA" to realm definition. UserDatabase part is defined as this in $TOMCAT_HOME/conf/server.xml:
<GlobalNamingResources>
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>
...
<Engine>
...
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
digest="SHA"
resourceName="UserDatabase" />
...
</Engine>
But after restart tomcat still treats all defined in $TOMCAT_HOME/conf/tomcat-users.xml passwords as plain-text ones.
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<user username="guest" password="e5e9fa1ba31ecd1ae84f75caaa474f3a663f05f4" roles="role1" />
</tomcat-users>
I.e. I can login with username/password guest/e5e9fa1ba31ecd1ae84f75caaa474f3a663f05f4, but not with guest/secret as it should be.
Please point me what I'm doing wrong?