@@ -334,9 +334,11 @@ Log levels from most to least verbose: `TRACE` → `DEBUG` → `INFO` → `WARN`
334334
335335### Custom TLS trust
336336
337- By default the TCP transport validates the broker certificate against the platform CA store. To
338- reach a broker behind a private or self-signed CA, pass a TLS customisation lambda to
339- ` TcpTransportFactory ` . It runs against ktor's ` TLSConfigBuilder ` :
337+ By default both transports validate the broker certificate against the platform CA store. To
338+ reach a broker behind a private or self-signed CA, pass a TLS customisation lambda to the
339+ transport factory you use — ` TcpTransportFactory ` , ` WebSocketTransportFactory ` , or both, since a
340+ factory without the lambda keeps validating against the platform store alone. It runs against
341+ ktor's ` TLSConfigBuilder ` :
340342
341343``` kotlin
342344import org.meshtastic.mqtt.transport.tcp.TcpTransportFactory
@@ -377,18 +379,21 @@ This scopes the extra trust to the MQTT connection alone. It replaces the app-wi
377379adding ` <certificates src="user"/> ` to ` network_security_config.xml ` , which would affect every
378380HTTPS connection the app makes.
379381
380- The hook composes with transport selection as usual:
382+ The hook composes with transport selection as usual, and both transports take the same lambda type,
383+ so one trust manager can serve both:
381384
382385``` kotlin
383386transportFactory = TcpTransportFactory { trustManager = myPrivateCaTrustManager } +
384- WebSocketTransportFactory ()
387+ WebSocketTransportFactory { trustManager = myPrivateCaTrustManager }
385388```
386389
387- ` TLSConfigBuilder ` comes from ` io.ktor:ktor-network-tls ` , exposed transitively by
388- ` mqtt-client-transport-tcp ` — no extra dependency needed. The WebSocket transport has no equivalent
389- hook yet. ` trustManager ` specifically is available on the JVM and Android actuals of
390- ` TLSConfigBuilder ` ; on Apple, Linux, and Windows targets the hook still runs, but ` TLSConfigBuilder `
391- exposes a different set of properties there.
390+ ` TLSConfigBuilder ` comes from ` io.ktor:ktor-network-tls ` , exposed transitively by both
391+ ` mqtt-client-transport-tcp ` and ` mqtt-client-transport-ws ` — no extra dependency needed.
392+ ` trustManager ` specifically is available on the JVM and Android actuals of ` TLSConfigBuilder ` ; on
393+ Apple and Linux the hook still runs, but ` TLSConfigBuilder ` exposes a different set of properties
394+ there. The WebSocket hook is additionally ignored on Windows (the WinHttp engine has no
395+ TLS-configuration surface) and in the browser (which cannot influence trust) — see
396+ ` transport-ws/Module.md ` for the per-target table.
392397
393398## Android / KMP Integration
394399
0 commit comments