Skip to content

Commit d95ce91

Browse files
committed
Set default port for TLS to 8883, fallback to 1883 if no port and TCP transport
1 parent abd57b3 commit d95ce91

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/configuration/parser.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,13 @@ def __parse_mqtt_transport(args: Namespace, config: Configuration) -> None:
107107

108108
if parse_result.port:
109109
config.mqtt_port = parse_result.port
110-
elif config.mqtt_transport_protocol == TransportProtocol.TCP:
111-
config.mqtt_port = 1883
112-
else:
110+
elif config.mqtt_transport_protocol == TransportProtocol.TLS:
111+
config.mqtt_port = 8883
112+
elif config.mqtt_transport_protocol == TransportProtocol.WS:
113113
config.mqtt_port = 9001
114+
else:
115+
# fallback to default mqtt port
116+
config.mqtt_port = 1883
114117
config.mqtt_host = str(parse_result.hostname)
115118

116119

0 commit comments

Comments
 (0)