# Eclipse Mosquitto configuration for the OtOpcUa MQTT driver integration fixture. # # SECURITY POSTURE — deliberate, and the whole reason this fixture exists. # `allow_anonymous false` is set GLOBALLY (with per_listener_settings false), so it # governs BOTH listeners. An anonymous fixture would let the driver's auth and TLS # code paths — including the CA-pin logic in MqttConnection.ConfigureTls / # ValidateAgainstPinnedCa — go completely untested, which is exactly backwards: those # are the paths whose failure mode is silent (a pin that never rejects anything looks # identical to a pin that works). # # The password file and the TLS material are NOT in git. Generate them first with # `./gen-fixture-material.sh` (see that script's banner); it writes ./secrets/, which # .gitignore excludes. # One global security policy rather than per-listener ones: with # per_listener_settings true, `allow_anonymous`/`password_file` would have to be # repeated under EVERY listener block, and a listener that forgot them would silently # fall back to allowing anonymous connections. Global + fail-closed is the safer shape. per_listener_settings false allow_anonymous false password_file /mosquitto/secrets/passwd # No persistence: the fixture is throwaway, and a persisted retained-message store # surviving a `docker compose down` would make the retained-seed test's outcome depend # on a previous run rather than on this one's publisher. persistence false log_dest stdout log_type error log_type warning log_type notice log_type information connection_messages true # --------------------------------------------------------------------------- # Plain (non-TLS) listener — smoke only. # # Still authenticated (allow_anonymous false above applies here too); it is the # TRANSPORT that is plaintext, not the access policy. It exists so the subscribe / # retained-seed / unauthored-topic legs can be exercised without dragging the TLS # handshake into every assertion, and so an operator can `mosquitto_sub` the fixture # by hand. Never a model for a deployment. # --------------------------------------------------------------------------- listener 1883 0.0.0.0 protocol mqtt # --------------------------------------------------------------------------- # TLS listener — the real one. # # `require_certificate false`: the driver authenticates with username/password over # TLS (the shape MqttDriverOptions models today); mutual TLS is not a driver feature # yet, so demanding a client certificate here would make the fixture untestable rather # than more secure. # # tls_version is deliberately NOT pinned: mosquitto's `tls_version` selects exactly # one version, so pinning 1.2 would refuse a .NET client that negotiated 1.3. Leaving # it unset lets OpenSSL negotiate the best mutually-supported version. # --------------------------------------------------------------------------- listener 8883 0.0.0.0 protocol mqtt cafile /mosquitto/secrets/ca.crt certfile /mosquitto/secrets/server.crt keyfile /mosquitto/secrets/server.key require_certificate false