Skip to content

Commit

Permalink
increase version for #442 (#444)
Browse files Browse the repository at this point in the history
Co-authored-by: Mark Boychuk <12628139+Marko298@users.noreply.github.com>
  • Loading branch information
webconn and Marko298 committed Jun 14, 2023
1 parent 60f813a commit 8095867
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/scripts/i18n/mqtt/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
},
"error": "Error",
"errors": {
"connect": "Failure to connect to {{host}}"
"connect": "Failure to connect to {{host}}",
"create": "Can't create MQTT connection, check logs"
}
}
}
3 changes: 2 additions & 1 deletion app/scripts/i18n/mqtt/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
},
"error": "Ошибка",
"errors": {
"connect": "Не удалось подключиться к {{host}}"
"connect": "Не удалось подключиться к {{host}}",
"create": "Не удалось создать MQTT-соединение, проверьте логи"
}
}
}
11 changes: 10 additions & 1 deletion app/scripts/services/mqttService.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ function mqttClient($window, $timeout, $q, topicMatches, mqttConnectTimeout,
connectOptions.password = password;
}

if(parseInt(port) === 443 || location.protocol === 'https:') {
connectOptions.useSSL = true
}

id = clientid;

retainIsDone = false;
Expand Down Expand Up @@ -169,7 +173,12 @@ function mqttClient($window, $timeout, $q, topicMatches, mqttConnectTimeout,
get: () => MAX_QUEUED_MESSAGES - client.inFlightMessages.length,
});

client.connect(angular.copy(connectOptions));
try {
client.connect(angular.copy(connectOptions));
} catch (e) {
console.log(e);
$translate('mqtt.errors.create').then(m => ngToast.danger(m));
}
};

//...........................................................................
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
wb-mqtt-homeui (2.67.2) stable; urgency=medium

* Switch MQTT client to SSL when connected via HTTPS (thanks @Marko298)

-- Nikita Maslov <nikita.maslov@wirenboard.ru> Wed, 14 Jun 2023 18:57:15 +0600

wb-mqtt-homeui (2.67.1) stable; urgency=medium

* Code refactoring. No functional changes
Expand Down

0 comments on commit 8095867

Please sign in to comment.