[EJBCA-CE/Wildfly 26] Unable to create HSM-backed crypto token when running as systemd service #554
-
Hello! I've been working on getting EJBCA-CE running with Wildfly 26 and using a YubiHSM2 via PKCS11 as a secure keystore.
Even upping the logging to TRACE using
didn't reveal anything more, however when trying the same thing in Docker, I was able to find the following line in the resulting stack trace:
Now this is strange, as the library is definitely installed:
Stopping Wildfly and running the following directly as the service user resolves the issue Wildfly is present in /opt/wildfly as a symlink to /opt/wildfly-26.1.3.Final Wildfly is running with the following unit file:
/etc/wildfly/wildfly.conf
Given that this issue only occurs when running under systemd, some kind of path/environment issue is all I can think of, but even putting all of user wildfly's environment variables into /etc/wildfly/wildfly.conf doesn't resolve the issue. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The issue was one of environment variables. After further debugging, the wildfly systemd unit was not picking up Manually adding this to /etc/wildfly/wildfly.conf resolved the issue. I suspect this would work with any HSM that runs into this issue, but I only have a YubiHSM2 to test with. |
Beta Was this translation helpful? Give feedback.
The issue was one of environment variables. After further debugging, the wildfly systemd unit was not picking up
YUBIHSM_PKCS11_CONF=/etc/yubihsm2/yubihsm_pkcs11.conf
from the environment.
Manually adding this to /etc/wildfly/wildfly.conf resolved the issue.
I suspect this would work with any HSM that runs into this issue, but I only have a YubiHSM2 to test with.