Disable TLS for the client proxy

This commit is contained in:
Garth Vander Houwen 2025-02-11 07:40:02 -08:00
parent 1ff452253b
commit 815af45b2d
3 changed files with 14 additions and 11 deletions

View file

@ -79,12 +79,12 @@
</EnvironmentVariable>
<EnvironmentVariable
key = "PUBLIC_MQTT_USERNAME"
value = "meshdev1"
value = "meshdev"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "PUBLIC_MQTT_PASSWORD"
value = "large4cats1"
value = "large4cats"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>

View file

@ -42,11 +42,10 @@ class MqttClientProxyManager {
let port = defaultServerPort
var username = node.mqttConfig?.username
var password = node.mqttConfig?.password
if host == defaultServerAddress {
username = ProcessInfo.processInfo.environment["PUBLIC_MQTT_USERNAME"]
password = ProcessInfo.processInfo.environment["PUBLIC_MQTT_PASSWORD"]
useSsl = false
}
// if host == defaultServerAddress {
//username = ProcessInfo.processInfo.environment["PUBLIC_MQTT_USERNAME"]
//password = ProcessInfo.processInfo.environment["PUBLIC_MQTT_PASSWORD"]
// }
let root = node.mqttConfig?.root?.count ?? 0 > 0 ? node.mqttConfig?.root : "msh"
let prefix = root!
topic = prefix + "/2/e" + "/#"

View file

@ -194,6 +194,7 @@ struct MQTTConfig: View {
}
.keyboardType(.default)
.scrollDismissesKeyboard(.interactively)
HStack {
Label("password", systemImage: "wallet.pass")
TextField("password", text: $password)
@ -214,11 +215,13 @@ struct MQTTConfig: View {
.keyboardType(.default)
.scrollDismissesKeyboard(.interactively)
.listRowSeparator(/*@START_MENU_TOKEN@*/.visible/*@END_MENU_TOKEN@*/)
Toggle(isOn: $tlsEnabled) {
Label("TLS Enabled", systemImage: "checkmark.shield.fill")
Text("Your MQTT Server must support TLS.")
if !proxyToClientEnabled {
Toggle(isOn: $tlsEnabled) {
Label("TLS Enabled", systemImage: "checkmark.shield.fill")
Text("Your MQTT Server must support TLS.")
}
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
}
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
}
}
Text("For all Mqtt functionality other than the map report you must also set uplink and downlink for each channel you want to bridge over Mqtt.")
@ -269,6 +272,7 @@ struct MQTTConfig: View {
.onChange(of: proxyToClientEnabled) { _, newProxyToClientEnabled in
if newProxyToClientEnabled {
jsonEnabled = false
tlsEnabled = false
}
if newProxyToClientEnabled != node?.mqttConfig?.proxyToClientEnabled { hasChanges = true }
}