Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

Commit

Permalink
fix(mqtt): use good config vars to connect to broker
Browse files Browse the repository at this point in the history
  • Loading branch information
btry authored and ajsb85 committed Nov 21, 2017
1 parent 429e09d commit fddb81b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions inc/mqttclient.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,19 +233,19 @@ protected function getMQTTConnection() {
'mqtt_broker_internal_address',
'mqtt_broker_port',
'mqtt_broker_tls_port',
'mqtt_broker_tls',
'mqtt_tls_for_backend',
'mqtt_broker_tls_ciphers',
'mqtt_user',
'mqtt_passwd'
]);
if (empty($config['mqtt_broker_internal_address'])
|| empty($config['mqtt_broker_port']) || empty($config['mqtt_broker_tls_port'])
|| (!isset($config['mqtt_broker_tls']))) {
|| (!isset($config['mqtt_tls_for_backend']))) {
return false;
} else {
$mqttBrokerAddress = $config['mqtt_broker_internal_address'];
$mqttBrokerPort = $config['mqtt_broker_port'];
$isTls = $config['mqtt_broker_tls'] != '0';
$isTls = $config['mqtt_tls_for_backend'] != '0';
if ($isTls) {
$mqttBrokerPort = $config['mqtt_broker_tls_port'];
}
Expand Down

0 comments on commit fddb81b

Please sign in to comment.