All Apps and Add-ons

MQTT Modular Input - Fails to connect via SSL/TLS

BenBurrows
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 mosquitto_sub / mosquitto_pub 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 mosquitto_sub / mosquitto_pub 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)
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...