DAP - Certificate validation failed on syslog-ng mTLS
Symptom
When syslog-ng on a DAP Follower attempts to connect to the port 1999 syslog-ng listener on a DAP Master, the DAP Master log includes log errors similar to the following:
<43>1 2020-04-30T17:53:49.080+00:00 1e4878a6f72e syslog-ng 16 - [meta sequenceId="9"] Certificate validation failed; subject='CN=RootCA', issuer='CN=RootCA', error='self signed certificate in certificate chain', depth='2'
Environment
11.1;11;11.2;11.3;11.4;11.5;11.6;11.7;12.0;20.7;21.1 DAP v11 and higher
Cause
This error means that syslog-ng can not find a CA certificate in the configured CA directory that matches the server or client cert that it's trying to validate.
Syslog-ng requires the CA cert to be named after a 32-bit hash of the subject's name. This is usually handled by creating a symlink to the CA cert file. This error may indicate that the symlink is missing or incorrect, rendering syslog- unable to find the CA cert.
Resolution
Manually fix the symlink using the following command:
ln -s ca.pem "$(openssl x509 -noout -subject_hash -in ca.pem).0"
or reimport the CA certificate using evoke:
evoke ca import --root ca.pem