Github user franz1981 commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/2011#discussion_r180998219
--- Diff:
artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/TextFileCertificateLoginModule.java
---
@@ -71,8 +79,12 @@ protected String getUserNameForCertificates(final
X509Certificate[] certs) throw
if (certs == null) {
throw new LoginException("Client certificates not found. Cannot
authenticate.");
}
-
- return usersByDn.get(getDistinguishedName(certs));
+ String dn = getDistinguishedName(certs);
+ String name = usersByDn.get(dn);
+ if (name == null && regexpByUser != null) {
+ name = getUserByRegexp(dn);
--- End diff --
`getUserByRegexp` is synchronized but there are uses of `usersByDn` and
`regexpByUser`, like these ones, that are not: what is the reason to have
`String getUserByRegexp(String dn)` synchronized?
---