Closed reubenmiller closed 5 months ago
Describe the bug
The tedge connect c8y does not use the port given via the c8y.mqtt configuration setting (feature introduced in https://github.com/thin-edge/thin-edge.io/issues/1931).
tedge connect c8y
c8y.mqtt
This affects cases where Cumulocity IoT is configured to use a non-default port of 8883.
The code currently incorrectly uses a static value of 8883 (see below):
8883
let mut mqtt_options = MqttOptions::new(bridge_config.remote_clientid.clone(), host[0], 8883);
However it must be noted that the c8y-bridge.conf uses the configured c8y.mqtt host/port.
c8y-bridge.conf
To Reproduce
The easiest way to check this is to set an incorrect port which should cause thin-edge.io not to connect (due to the misconfigured port).
Set the c8y.url
c8y.url
tedge config c8y.url thin-edge-io.eu-latest.cumulocity.com
Set a custom c8y.mqtt value which uses an invalid port 1234
1234
tedge config set c8y.mqtt thin-edge-io.eu-latest.cumulocity.com:1234
It is expected that the tedge connect c8y should fail (due to the incorrect port)
Expected behavior
When the user specifies a custom MQTT port using the c8y.mqtt configuration.
Screenshots
Environment (please complete the following information):
Any
1.0.1
Additional context
QA has thoroughly checked the bug and here are the results:
Describe the bug
The
tedge connect c8y
does not use the port given via thec8y.mqtt
configuration setting (feature introduced in https://github.com/thin-edge/thin-edge.io/issues/1931).This affects cases where Cumulocity IoT is configured to use a non-default port of 8883.
The code currently incorrectly uses a static value of
8883
(see below):let mut mqtt_options = MqttOptions::new(bridge_config.remote_clientid.clone(), host[0], 8883);
However it must be noted that the
c8y-bridge.conf
uses the configuredc8y.mqtt
host/port.To Reproduce
The easiest way to check this is to set an incorrect port which should cause thin-edge.io not to connect (due to the misconfigured port).
Set the
c8y.url
Set a custom
c8y.mqtt
value which uses an invalid port1234
It is expected that the
tedge connect c8y
should fail (due to the incorrect port)Expected behavior
When the user specifies a custom MQTT port using the
c8y.mqtt
configuration.Screenshots
Environment (please complete the following information):
Any
Any
Any
1.0.1
Additional context