summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ebf73b6)
raw | patch | inline | side by side (parent: ebf73b6)
author | Florian Forster <octo@collectd.org> | |
Wed, 20 Sep 2017 20:20:51 +0000 (22:20 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Wed, 20 Sep 2017 20:21:06 +0000 (22:21 +0200) |
Fixes: #2419
src/collectd.conf.in | patch | blob | history | |
src/mqtt.c | patch | blob | history |
diff --git a/src/collectd.conf.in b/src/collectd.conf.in
index fa6c96c1628d6c1fa8879f5750d5971da7b4415d..86ea1a67f6cab2480b4d312d53b8291e8ec7026d 100644 (file)
--- a/src/collectd.conf.in
+++ b/src/collectd.conf.in
# QoS 2
# Topic "collectd/#"
# CleanSession true
+# CACert "/etc/ssl/ca.crt"
+# CertificateFile "/etc/ssl/client.crt"
+# CertificateKeyFile "/etc/ssl/client.pem"
+# TLSProtocol "tlsv1.2"
+# CipherSuite "ciphers"
# </Subscribe>
#</Plugin>
diff --git a/src/mqtt.c b/src/mqtt.c
index 851866b082051d38b9f292de35eae691ed6d7a75..516448557f94e326f934729193c63cd094a6bd58 100644 (file)
--- a/src/mqtt.c
+++ b/src/mqtt.c
* StoreRates true
* Retain false
* QoS 0
- * CACert "ca.pem" Enables TLS if set
- * CertificateFile "client-cert.pem" optional
- * CertificateKeyFile "client-key.pem" optional
- * TLSProtocol "tlsv1.2" optional
+ * CACert "ca.pem" Enables TLS if set
+ * CertificateFile "client-cert.pem" optional
+ * CertificateKeyFile "client-key.pem" optional
+ * TLSProtocol "tlsv1.2" optional
* </Publish>
*/
static int mqtt_config_publisher(oconfig_item_t *ci) {
* User "guest"
* Password "secret"
* Topic "collectd/#"
+ * CACert "ca.pem" Enables TLS if set
+ * CertificateFile "client-cert.pem" optional
+ * CertificateKeyFile "client-key.pem" optional
+ * TLSProtocol "tlsv1.2" optional
* </Subscribe>
*/
static int mqtt_config_subscriber(oconfig_item_t *ci) {
cf_util_get_string(child, &conf->topic);
else if (strcasecmp("CleanSession", child->key) == 0)
cf_util_get_boolean(child, &conf->clean_session);
+ else if (strcasecmp("CACert", child->key) == 0)
+ cf_util_get_string(child, &conf->cacertificatefile);
+ else if (strcasecmp("CertificateFile", child->key) == 0)
+ cf_util_get_string(child, &conf->certificatefile);
+ else if (strcasecmp("CertificateKeyFile", child->key) == 0)
+ cf_util_get_string(child, &conf->certificatekeyfile);
+ else if (strcasecmp("TLSProtocol", child->key) == 0)
+ cf_util_get_string(child, &conf->tlsprotocol);
+ else if (strcasecmp("CipherSuite", child->key) == 0)
+ cf_util_get_string(child, &conf->ciphersuite);
else
ERROR("mqtt plugin: Unknown config option: %s", child->key);
}