MQTT: disable https hostname verification (#820)

After the bump of Paho from 1.2.0 to 1.2.1 the library enables the https
hostname verification.
This breaks compatibility with current consumers.
Connections cannot be established anymore.

We disable the https hostname verification to keep the old behaviour.
We should add an API so the hostname verification can be enabled if
desired.

This also makes the version 1.2.1 the lower version limit as we need to
use the API to disable the verification internally.

Related to: https://github.com/openhab/openhab-core/issues/815

Signed-off-by: Markus Rathgeb <maggu2810@gmail.com>
This commit is contained in:
Markus Rathgeb 2019-05-15 17:57:49 +02:00 committed by Christoph Weitkamp
parent dc5ddba83c
commit d55d59d3b5
2 changed files with 2 additions and 1 deletions

View File

@ -206,7 +206,7 @@
<dependency>
<groupId>org.eclipse.paho</groupId>
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
<version>1.2.0</version>
<version>1.2.1</version>
<scope>compile</scope>
</dependency>

View File

@ -632,6 +632,7 @@ public class MqttBrokerConnection {
}
options.setKeepAliveInterval(keepAliveInterval);
options.setHttpsHostnameVerificationEnabled(false);
return options;
}