All Apps and Add-ons
Highlighted

MQTT Modular Input - Fails to connect via SSL/TLS

Explorer

I have a Splunk 7.2.1 docker image.
I installed Java 1.8.0_181 in the container
I installed the MQTT Modular input via the GUI

I configured a mosquitto MQTT server (NON-SSL/TLS)
I used the mosquittosub / mosquittopub cli tools to confirm all is working.
I connected the MQTT Modular input to the mosquitto server and receive messages just fine into splunk.

I reconfigure mosquitto to use a cert signed by a self created CA (ie not verisign etc etc). I have the ca.crt file.
I used the mosquittosub / mosquittopub cli tools to confirm all is working via TLS/SSL by adding "--cafile ca.crt". Noteably I did NOT change the port from the default port of 1883.

The next steps are guesswork and what I got from googling. Unfortunately there is not really any documentation for using TLS/SSL with this modular input. Right by the "UseSSL" tickbox it just says "Use the "Additional JVM System Properties" parameter to configure key and trust stores." but does not give any further clues as to what settings to actually use.

I copied the ca.crt file to the docker container and ran:
sudo keytool -importcert -keystore /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/cacerts -file ca.crt

I ticked the "Use SSL" checkbox for the MQTT Modular input and got connection failures logged.
I added the following in the Additional JVM System Properties:
javax.net.ssl.trustStore=/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/cacerts,javax.net.ssl.trustStorePassword=changeit

That still had connection errors so I tried
Djavax.net.ssl.trustStore=/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/cacerts,Djavax.net.ssl.trustStorePassword=changeit
That also failed.

I am really unfamiliar with Java so any help would be appreciated

12-11-2018 16:07:47.771 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/mqtt_ta/bin/mqtt.py"  ... 3 more
12-11-2018 16:07:47.771 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/mqtt_ta/bin/mqtt.py"  at org.eclipse.paho.client.mqttv3.internal.TCPNetworkModule.start(TCPNetworkModule.java:66)
12-11-2018 16:07:47.771 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/mqtt_ta/bin/mqtt.py"  at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:673)
12-11-2018 16:07:47.771 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/mqtt_ta/bin/mqtt.py"  at java.net.Socket.connect(Socket.java:589)
12-11-2018 16:07:47.771 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/mqtt_ta/bin/mqtt.py"  at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
12-11-2018 16:07:47.771 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/mqtt_ta/bin/mqtt.py"  at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
12-11-2018 16:07:47.771 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/mqtt_ta/bin/mqtt.py"  at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
12-11-2018 16:07:47.771 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/mqtt_ta/bin/mqtt.py"  at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
12-11-2018 16:07:47.771 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/mqtt_ta/bin/mqtt.py"  at java.net.PlainSocketImpl.socketConnect(Native Method)
12-11-2018 16:07:47.771 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/mqtt_ta/bin/mqtt.py" Caused by: java.net.ConnectException: Connection refused (Connection refused)
12-11-2018 16:07:47.771 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/mqtt_ta/bin/mqtt.py"  at java.lang.Thread.run(Thread.java:748)
12-11-2018 16:07:47.771 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/mqtt_ta/bin/mqtt.py"  at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:538)
12-11-2018 16:07:47.771 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/mqtt_ta/bin/mqtt.py"  at org.eclipse.paho.client.mqttv3.internal.SSLNetworkModule.start(SSLNetworkModule.java:77)
12-11-2018 16:07:47.771 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/mqtt_ta/bin/mqtt.py"  at org.eclipse.paho.client.mqttv3.internal.TCPNetworkModule.start(TCPNetworkModule.java:75)
12-11-2018 16:07:47.771 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/mqtt_ta/bin/mqtt.py" Stanza mqtt://mqtt_test : Error connecting : Unable to connect to server (32103) - java.net.ConnectException: Connection refused (Connection refused)
0 Karma