--- title: "Integration notes" source_url: https://dev.digicert.com/trustcore-sdk/nanomqtt/integration-notes.html --- Use the steps below as a general guide for binding NanoMQTT to either *clear-text TCP* or *TLS*. ## Switch transports in one line ```c /* TLS (port 8883, NanoSSL already negotiated) */ MQTT_setTransportSSL(conn, ssl); /* Plain TCP (port 1883) */ MQTT_setTransportTCP(conn, socketFd); ``` > **Info** > > Call one of the above **before** `MQTT_negotiateConnection()`. The rest of the API is identical. ## Build note The socket helpers are always available. Enable the asynchronous wrapper only if you need it: ```bash # static or CMake: add the macro -D__ENABLE_MQTT_ASYNC_CLIENT__ # helper script ./build_mqtt_client.sh --async ``` ## Quick validation 1. **Pass 1 - TCP** Bind with `MQTT_setTransportTCP`; connect to port 1883 and publish a test message. 2. **Pass 2 - TLS** Switch to `MQTT_setTransportSSL`, port 8883, and supply `--ssl_ca_file `. The payload and topic should be identical. A match between the two passes confirms both the NanoSSL handshake and the MQTT control flow.