Security configuration#
MQTTBroker accepts the same security object pattern as other FastStream brokers where supported.
TLS#
Use the URL scheme to select the transport. mqtt:// uses plain TCP and defaults to port 1883; mqtts:// enables TLS and defaults to port 8883.
For custom TLS settings, pass an SSL context with BaseSecurity.
Username and password#
Provide percent-encoded credentials in the URL or use SASLPlaintext from faststream.security.
Unsupported security subclasses raise NotImplementedError at broker construction time.
Note
MQTT connection URLs support only mqtt:// and mqtts:// TCP/TLS endpoints. Paths, query parameters, and fragments are rejected.