Configuration Section
All security settings are configured within the<security> element:
UTF-8 Validation
Validate that topics and client identifiers are well-formed UTF-8 strings.Configuration
true
Description
When enabled, HiveMQ validates that:- Client identifiers are valid UTF-8
- Topic names in PUBLISH, SUBSCRIBE, and UNSUBSCRIBE packets are valid UTF-8
Recommendation
Keep this enabled for compliance with the MQTT specification and to prevent encoding issues.Payload Format Validation
Validate message payloads according to the MQTT 5 Payload Format Indicator.Configuration
false
Description
When enabled, HiveMQ validates that message payloads match the Payload Format Indicator:- If the indicator is
1(UTF-8), the payload is validated as UTF-8 - If validation fails, the message is not delivered
Use Cases
- Enable when you need strict payload validation
- Disable for binary payloads or when you handle validation in your application
Allow Empty Client ID
Allow clients to connect with an empty client identifier.Configuration
true
Description
When enabled, HiveMQ allows clients to connect with an empty client identifier. The server will automatically assign a unique client identifier. This is standard behavior for MQTT 3.1.1 and MQTT 5 with clean session/clean start set totrue.
Recommendation
- Keep enabled for MQTT 3.1.1 and MQTT 5 compliance
- Disable if you require all clients to provide their own identifier
Allow Request Problem Information
Allow clients to request problem information in MQTT 5.Configuration
true
Description
When enabled, clients can request that the server include reason strings and user properties in error responses (MQTT 5 feature). When disabled:- Reason strings are not sent in CONNACK, PUBACK, PUBREC, PUBREL, PUBCOMP, SUBACK, UNSUBACK, and DISCONNECT packets
- User properties are not sent in these packets
Use Cases
- Enable for better debugging and error reporting
- Disable to reduce bandwidth usage and improve privacy
Complete Example
Here’s a complete example with all security settings:Recommended Settings
Development Environment
Production Environment
Additional Security
For comprehensive security, also consider:- Using TLS listeners (see Listeners)
- Implementing authentication and authorization via extensions
- Configuring restrictions (see Restrictions)
- Network-level security (firewalls, VPNs)
- Regular security updates and monitoring