-
Problem report
-
Resolution: Unresolved
-
Major
-
None
-
7.0.11, 7.2.5
-
None
-
Support backlog
By default, there is no configuration option exposed for disabling TLS verification in the MQTT plugin in Zabbix Agent. In the source, the call to tlsconfig.CreateConfig has skipVerify hardcoded to false.
Some implementations of MQTT, such as servers configured by vendors, may be using TLS configurations that are not changable by the system administrator, and are configurations that cannot be made valid. In my case, the vendor uses a certificate that contains a non FQDN CN and no subjectAltName so no configuration can be made to pass the TLS validation.
In this case, a user configurable option in the mqtt.conf file should be presented to disable TLS validation.
Offending code line:
https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/src/go/plugins/mqtt/mqtt.go#132
return tlsconfig.CreateConfig(
tlsconfig.Details{
TlsCaFile: d.TlsCaFile,
TlsCertFile: d.TlsCertFile,
TlsKeyFile: d.TlsKeyFile,
RawUri: d.RawUri,
},
false, <------
)
Note: Happy to provide a PR to resolve this issue via a configuration option if this is acceptable.
Steps to reproduce:
- Configure MQTT on the Zabbix Agent 2
- Attempt to connect to a server with invalid TLS
Result:
network Error : tls: failed to verify certificate
Expected:
Should be able to disable TLS validation