MQTT Broker - Set HTTPS Hostname Verification Enabled Error

Hey all,

os: Ubuntu 18.04.2 LTS
OH: 2.5.0~S1642
Hardware: Nuc

Little back story - My OH2 install went down about 2 months when I took a power surge and got SD corruption on my Pi. I am finally getting around to bringing it back online after purchasing a NUC and UPS :slight_smile:

I had an older backup that I used to restore OH. After restore, things seemed to go pretty well, I proceeded to start fixing some configuration changes that I wanted to make. Somewhere in this process, I must have messed something up with my MQTT Broker. In PaperUI, I am getting a status of “UNINITIALIZED - HANDLER_INITIALIZING_ERROR”, followed by "org.eclipse.paho.client.mqttv3.MqttConnectOptions.setHttpsHostnameVerificationEnabled(Z)V"

I have been trying to search the forum and google about this issue, but cannot make heads or tails. I imagine has something to do with a Cert for the Mosquitto broker?

I have Mosquitto installed on the NUC, just like I did on the Pi. I even gave it same Static IP as the Pi from before. I never used SSL before, only standard 1883. The Broker itself is running as my various devices that use MQTT are posting messages to it just fine, as viewed via MQTTfx.

Appreciate y’all taking a look at this and giving any thoughts.

Thanks - JMac

Broker config in Paper

Here are some portions from the log:

    java.lang.NoSuchMethodError: org.eclipse.paho.client.mqttv3.MqttConnectOptions.setHttpsHostnameVerificationEnabled(Z)V
    	at org.eclipse.smarthome.io.transport.mqtt.MqttBrokerConnection.createMqttOptions(MqttBrokerConnection.java:635) ~[?:?]
    	at org.eclipse.smarthome.io.transport.mqtt.MqttBrokerConnection.start(MqttBrokerConnection.java:720) ~[?:?]
    	at org.openhab.binding.mqtt.handler.AbstractBrokerHandler.initialize(AbstractBrokerHandler.java:101) ~[?:?]
    	at org.openhab.binding.mqtt.handler.BrokerHandler.initialize(BrokerHandler.java:225) ~[?:?]
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
    	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
    	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [137:org.openhab.core:2.5.0.201907220301]
    	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [137:org.openhab.core:2.5.0.201907220301]
    	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
    	at java.lang.Thread.run(Thread.java:748) [?:?]
    ==> /var/log/openhab2/events.log <==
    2019-07-22 11:48:29.123 [hingStatusInfoChangedEvent] - 'mqtt:broker:425e33a8' changed from OFFLINE to UNINITIALIZED (HANDLER_INITIALIZING_ERROR): org.eclipse.paho.client.mqttv3.MqttConnectOptions.setHttpsHostnameVerificationEnabled(Z)V
    ==> /var/log/openhab2/openhab.log <==
    2019-07-22 11:48:29.123 [ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing 'mqtt:broker:425e33a8': org.eclipse.paho.client.mqttv3.MqttConnectOptions.setHttpsHostnameVerificationEnabled(Z)V
    java.lang.NoSuchMethodError: org.eclipse.paho.client.mqttv3.MqttConnectOptions.setHttpsHostnameVerificationEnabled(Z)V
    	at org.eclipse.smarthome.io.transport.mqtt.MqttBrokerConnection.createMqttOptions(MqttBrokerConnection.java:635) ~[?:?]
    	at org.eclipse.smarthome.io.transport.mqtt.MqttBrokerConnection.start(MqttBrokerConnection.java:720) ~[?:?]
    	at org.openhab.binding.mqtt.handler.AbstractBrokerHandler.initialize(AbstractBrokerHandler.java:101) ~[?:?]
    	at org.openhab.binding.mqtt.handler.BrokerHandler.initialize(BrokerHandler.java:225) ~[?:?]
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
    	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
    	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [137:org.openhab.core:2.5.0.201907220301]
    	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [137:org.openhab.core:2.5.0.201907220301]
    	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
    	at java.lang.Thread.run(Thread.java:748) [?:?]```

In case anyone runs into this like I did… I had an older copy of Paho in my Add-Ons folder from another binding. OH needs >=1.2.1 of Paho, while I had 1.2.0.

Deleted the offending Paho in add-ons, stopped service, cleared cache, rebooted and it was good to go.