wolfMQTT is a small, fast, portable MQTT client implementation, including support for TLS 1.3.
Repo wolfSSL/wolfMQTT, read from GitHub 9 h ago. wolfSSL has not joined Take My Repo.
wolfSSL/wolfMQTT is a public repo on GitHub by wolfSSL. wolfMQTT is a small, fast, portable MQTT client implementation, including support for TLS 1.3. It declares the GPL-3.0 license on GitHub. It is written mainly in C, has 597 stars and last changed on 2026-11-22. Nobody has reviewed it on Take My Repo yet, which says nothing about its quality. Read from GitHub on 2026-11-23.
In the maintainer's words. Shown from GitHub; Take My Repo does not keep a copy.
This is an implementation of the MQTT Client written in C for embedded use, which supports SSL/TLS via the wolfSSL library. This library was built from the ground up to be multi-platform, space conscious and extensible. Integrates with wolfSSL to provide TLS support.
For details on wolfMQTT see the wolfMQTT Manual.
./autogen.sh (if cloned from GitHub)./configure (to see a list of build options use ./configure --help)makesudo make installNotes:
wolfssl was recently installed, run sudo ldconfig to update the linker cache.--enable-debug or --enable-debug=verbose (for extra logging)../configure --help.wolfmqtt/options.h.For building wolfMQTT with TLS support in Visual Studio:
<wolfssl-root>/wolfssl64.sln.Retarget solution).Debug DLL or Release DLL configuration is selected. Make note if you are building 32-bit x86 or 64-bit x64.wolfssl.lib and wolfssl.dll files into <wolfmqtt-root>.DLL Debug with x86 the files are in: DLL Debug.DLL Release with x86 the files are in: DLL Release.DLL Debug with x64 the files are in: x64/DLL Debug.DLL Release with x64 the files are in: x64/DLL Release.<wolfmqtt-root>/wolfmqtt.sln solution.x86 or x64 selected) as used in wolfSSL above../../wolfssl/. If your wolfssl root location is different you can go into the project settings and adjust this in C/C++ -> General -> Additional Include Directories.wolfmqtt/vs_settings.h.CMake supports compiling in many environments including Visual Studio
if CMake support is installed. The commands below can be run in
Developer Command Prompt.
mkdir build
cd build
# to use installed wolfSSL location (library and headers)
cmake .. -DWITH_WOLFSSL=/prefix/to/wolfssl/install/
# OR to use a wolfSSL source tree
cmake .. -DWITH_WOLFSSL_TREE=/path/to/wolfssl/
# build
cmake --build .
Verified TLS connections to IP addresses require wolfSSL 5.9.1 or newer built
with WOLFSSL_IP_ALT_NAME to verify the certificate's IP address subject
alternative name; otherwise they fail before the handshake. DNS name
verification also works with older wolfSSL releases.
Legacy numeric IP spellings, bracketed IPv6, and scoped IPv6 are rejected.
wolfSSL 5.9.2 and newer also reject single-label DNS names other than
localhost during identity setup. Use a fully qualified DNS name for
portable verified connections.
The library's default VERIFY_NONE context skips these identity checks.
Application TLS callbacks that disable server authentication, either with
WOLFSSL_VERIFY_NONE or a verification callback that accepts all certificates,
must set MQTT_CLIENT_FLAG_TLS_SKIP_HOST_CHECK with MqttClient_Flags.
The flag skips host identity setup only; it does not change wolfSSL's
certificate verification policy. Set it on each new connection, since
disconnect clears it. The example sets it for -t without -A and for
WOLFMQTT_ALLOW_INSECURE_TLS. Without that override, embedded CA builds
still verify the peer.
Compatibility change: TLS callbacks that configure their own certificate
identity on client->tls.ssl must also set
MQTT_CLIENT_FLAG_TLS_CUSTOM_PEER_NAME after the name or IP check succeeds.
Otherwise, wolfMQTT replaces that identity with the connection host.
Additional CMake options:
-DWOLFMQTT_UNIT_TESTS=no disables the wolfmqtt_unit_tests target (default yes). The target is only added when wolfMQTT is the top-level project, so downstream consumers using add_subdirectory() are unaffected.You can download and install wolfMQTT using the vcpkg:
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
OR for Windows
bootstrap-vcpkg.bat
./vcpkg integrate install
./vcpkg install wolfmqtt
The wolfMQTT port in vcpkg is kept up to date by wolfSSL.
We also have vcpkg ports for wolftpm, wolfssl and curl.
See README.md at IDE/ARDUINO.README.md
export PATH="/opt/mingw-w32-bin_i686-darwin/bin:$PATH"
export PREFIX=$PWD/build
# wolfSSL
cd wolfssl
./configure --host=i686 CC=i686-w64-mingw32-gcc LD=i686-w64-mingw32-ld CFLAGS="-DWIN32 -DMINGW -D_WIN32_WINNT=0x0600" LIBS="-lws2_32 -L$PREFIX/lib -lwolfssl" --prefix=$PREFIX
make
make install
# wolfMQTT
cd ../wolfmqtt
./configure --host=i686 CC=i686-w64-mingw32-gcc LD=i686-w64-mingw32-ld CFLAGS="-DWIN32 -DMINGW -D_WIN32_WINNT=0x0600 -DBUILDING_WOLFMQTT -I$PREFIX/include" LDFLAGS="-lws2_32 -L$PREFIX/lib -lwolfssl" --prefix=$PREFIX --disable-examples
make
Support for Zephyr is available in the zephyr directory. For instructions on how to build for Zephyr, see the README.md.
The library has three components.
This is where the top level application interfaces for the MQTT client reside.
int MqttClient_Init(MqttClient *client, MqttNet *net, MqttMsgCb msg_cb, byte *tx_buf, int tx_buf_len, byte *rx_buf, int rx_buf_len, int cmd_timeout_ms);These API's are blocking on MqttNet.read until error/timeout (cmd_timeout_ms):
int MqttClient_Connect(MqttClient *client, MqttConnect *connect);int MqttClient_Publish(MqttClient *client, MqttPublish *publish);int MqttClient_Subscribe(MqttClient *client, MqttSubscribe *subscribe);int MqttClient_Unsubscribe(MqttClient *client, MqttUnsubscribe *unsubscribe);int MqttClient_Ping(MqttClient *client);int MqttClient_Disconnect(MqttClient *client);This function blocks waiting for a new publish message to arrive for a maximum duration of timeout_ms.
int MqttClient_WaitMessage(MqttClient *client, MqttMessage *message, int timeout_ms);These are the network connect / disconnect interfaces that wrap the MqttNet callbacks and handle WolfSSL TLS:
int MqttClient_NetConnect(MqttClient *client, const char* host, word16 port, int timeout_ms, int use_tls, MqttTlsCb cb);int MqttClient_NetDisconnect(MqttClient *client);int MqttClient_NetDisconnect_Wait(MqttClient *client); - like MqttClient_NetDisconnect, but in WOLFMQTT_MULTITHREAD builds waits for other threads' network I/O on the client to finish first. Do not call it from a message, property or publish payload callback; where thread identities are available it returns MQTT_CODE_ERROR_STAT there instead of deadlocking.Helper functions:
const char* MqttClient_ReturnCodeToString(int return_code);This is where all the packet encoding/decoding is handled.
The header contains the MQTT Packet structures for:
MqttConnectMqttPublish / MqttMessage (they are the same)MqttSubscribeMqttUnsubscribeThis is where the transport socket optionally wraps TLS and uses the MqttNet callbacks for the platform specific network handling.
The header contains the MQTT Network structure MqttNet for network callback and context.
Here are the steps for creating your own implementation.
examples/mqttnet.c and examples/mqttnet.h.MqttNet structure.MqttClient_Init passing in a MqttClient structure pointer, MqttNet structure pointer, MqttMsgCb function pointer, TX/RX buffers with maximum length and command timeout.MqttClient_NetConnect to connect to broker over network. If use_tls is non-zero value then it will perform a TLS connection. The TLS callback MqttTlsCb should be defined for wolfSSL certificate configuration.MqttClient_Connect passing pointer to MqttConnect structure to send MQTT connect command and wait for Connect Ack.MqttClient_Subscribe passing pointer to MqttSubscribe structure to send MQTT Subscribe command and wait for Subscribe Ack (depending on QoS level).MqttClient_WaitMessage passing pointer to MqttMessage to wait for incoming MQTT Publish message.The example MQTT client is located in /examples/mqttclient/. This example exercises many of the exposed API's and prints any incoming publish messages for subscription topic "wolfMQTT/example/testTopic". This client contains examples of many MQTTv5 features, including the property callback and server assignment of client ID. The mqqtclient example is a good starting template for your MQTT application.
The example MQTT client is located in /examples/mqttsimple/. This example demonstrates a standalone client using standard BSD sockets. This requires HAVE_SOCKET to be defined, which comes from the ./configure generated wolfmqtt/config.h file. All parameters are build-time macros defined at the top of /examples/mqttsimple/mqttsimple.c.
The example MQTT client is located in /examples/nbclient/. This example uses non-blocking I/O for message exchange. The wolfMQTT library must be configured with the --enable-nonblock option (or built with WOLFMQTT_NONBLOCK).
The MQTT firmware update is located in /examples/firmware/. This example has two parts. The first is called "fwpush", which signs and publishes a firmware image. The second is called "fwclient", which receives the firmware image and verifies the signature. This example publishes message on the topic "wolfMQTT/example/firmware". The "fwpush" application is an example of using a publish callback to send the payload data.
We setup a wolfMQTT IoT Hub on the Azure server for testing. We added a device called demoDevice, which you can connect and publish to. The example demonstrates creation of a SasToken, which is used as the password for the MQTT connect packet. It also shows the topic names for publishing events and listening to devicebound messages. This example only works with ENABLE_MQTT_TLS set and the wolfSSL library present because it requires Base64 Encode/Decode and HMAC-SHA256. Note: The wolfSSL library must be built with ./configure --enable-base64encode or #define WOLFSSL_BASE64_ENCODE. The wc_GetTime API was added in 3.9.1 and if not present you'll need to implement your own version of this to get current UTC seconds or update your wolfSSL library.
NOTE The Azure broker only supports MQTT v3.1.1
We setup an AWS IoT endpoint and testing device certificate for testing. The AWS server uses TLS client certificate for authentication. The example is located in /examples/aws/. The example subscribes to $aws/things/"AWSIOT_DEVICE_ID"/shadow/update/delta and publishes to $aws/things/"AWSIOT_DEVICE_ID"/shadow/update.
NOTE The AWS broker only supports MQTT v3.1.1
This example enables the wolfMQTT client to connect to the IBM Watson Internet of Things (WIOT) Platform. The WIOT Platform has a limited test broker called "Quickstart" that allows non-secure connections to exercise the component. The example is located in /examples/wiot/. Works with MQTT v5 support enabled.
NOTE The WIOT Platform will be disabled DEC2023. The demo may still be useful for users of IBM Watson IOT.
The Sensor Network client implements the MQTT-SN protocol for low-bandwidth networks. There are several differences from MQTT, including the ability to use a two byte Topic ID instead the full topic during subscribe and publish. The SN client requires an MQTT-SN gateway. The gateway acts as an intermediary between the SN clients and the broker. This client was tested with the Eclipse Paho MQTT-SN Gateway, which connects by default to the public Eclipse broker, much like our wolfMQTT Client example. The address of the gateway must be configured as the host. The example is located in /examples/sn-client/.
More about MQTT-SN examples in examples/sn-client/README.md
This example exercises the multithreading capabilities of the client library. The client implements two tasks: one that publishes to the broker; and another that waits for messages from the broker. The publish thread is created NUM_PUB_TASKS times (5 by default) and sends unique messages to the broker. This feature is enabled using the --enable-mt configuration option. The example is located in /examples/multithread/.
The multi-threading feature can also be used with the non-blocking socket (--enable-nonblock).
If you are having issues with thread synchronization on Linux consider using not the conditional signal (WOLFMQTT_NO_COND_SIGNAL).
With WOLFMQTT_NO_COND_SIGNAL, or with WOLFMQTT_USER_THREADING unless WOLFMQTT_SEM_SIGNAL is defined, a write-only publish or MqttClient_CancelMessage whose response another thread is decoding waits for that thread to release the receive lock instead of being signalled. A thread that blocks in MqttClient_WaitMessage can then hold them up until its read returns.
In the examples/pub-sub folder, there are two simple client examples:
These examples are useful for quickly testing or scripting.
The command line examples can be executed with optional parameters. To see a list of the available parameters, add the -?
./examples/mqttclient/mqttclient -?
mqttclient:
-? Help, print this usage
-h <host> Host to connect to, default: test.mosquitto.org
-p <num> Port to connect on, default: Normal 1883, TLS 8883
-t Enable TLS
-A <file> Load CA (validate peer)
-K <key> Use private key (for TLS mutual auth)
-c <cert> Use certificate (for TLS mutual auth)
-S <str> Use Host Name Indication, blank defaults to host
-q <num> Qos Level 0-2, default: 0
-s Disable clean session connect flag
-k <num> Keep alive seconds, default: 60
-i <id> Client Id, default: WolfMQTTClient
-l Enable LWT (Last Will and Testament)
-u <str> Username
-w <str> Password
-m <str> Message, default: test
-n <str> Topic name, default: wolfMQTT/example/testTopic
-r Set Retain flag on publish message
-C <num> Command Timeout, default: 30000ms
-P <num> Max packet size the client will accept, default: 1048576
-T Test mode
-f <file> Use file contents for publish
The available options vary depending on the library configuration.
wolfMQTT client library has been tested with the following brokers:
The initially supported version with full specification support for all features and packets type such as:
The wolfMQTT client supports connecting to v5 enabled brokers when configured with the --enable-v5 option.
The following v5.0 specification features are supported by the wolfMQTT client:
The v5 enabled wolfMQTT client was tested with the following MQTT v5 brokers:
./examples/mqttclient/mqttclient -h localhost./examples/mqttclient/mqttclient -h "mqtt.flespi.io" -u "<your-flespi-token>"./examples/mqttclient/mqttclient -h localhost./examples/mqttclient/mqttclient -h localhost./examples/mqttclient/mqttclient -h 833f87e253304692bd2b911f0c18dba1.s1.eu.hivemq.cloud -t -S -u wolf1 -w NEZjcm7i8eRjFKF -p 8883./examples/mqttclient/mqttclient -h "broker.emqx.io"Properties are allocated from a local stack (size MQTT_MAX_PROPS) by default. Define WOLFMQTT_DYN_PROP to use malloc for property allocation.
The wolfMQTT SN Client implementation is based on the OASIS MQTT-SN v1.2 specification. The SN API is configured with the --enable-sn option. There is a separate API for the sensor network API, which all begin with the "SN_" prefix. The wolfMQTT SN Client operates over UDP, which is distinct from the wolfMQTT clients that use TCP. The following features are supported by the wolfMQTT SN Client:
Unsupported features:
The SN client was tested using the Eclipse Paho MQTT-SN Gateway (https://github.com/eclipse/paho.mqtt-sn.embedded-c) running locally and on a separate network node. Instructions for building and running the gateway are in the project README.
Recently the OpenQuantumSafe project has integrated their fork of OpenSSL with the mosquito MQTT broker. You can now build wolfMQTT with wolfSSL and use that to publish to the mosquito MQTT broker. Currently, wolfMQTT supports the ML_KEM_768 and SecP384r1MLKEM768 groups and ML-DSA-65 for authentication in TLS 1.3. This works on Linux.
To get started, you can use the oqs-demos repo at https://github.com/open-quantum-safe/oqs-demos/ .
Follow all the instructions in README.md and USAGE.md. This allows you to create a docker image and a docker network. Then you will run a broker, a subscriber and a publisher. At the end the publisher will exit and the broker and subscriber will remain active.
NOTE: Do not stop the broker and the subscriber instances.
You will need to get into a docker instance and get the following files onto your local machine:
Once the publisher exits, the following command can be executed:
sudo docker run --network mosquitto-test --ip 174.18.0.4 -it --rm --name oqs-mosquitto-publisher -e "BROKER_IP=174.18.0.2" -e "PUB_IP=174.18.0.4" oqs-mosquitto bash
This opens a bash shell "inside" the docker container. You'll see the shell script for executing the publisher. This includes commands for generating the keys and certificates. Execute them and then use cat to display them and then copy and paste them into the wolfMQTT root directory.
Build and install wolfSSL like this:
./autogen.sh (if obtained from github)
./configure --enable-dilithium --enable-mlkem
make all
make check
No special flags are required for building wolfMQTT. Simply do the following:
./autogen.sh (if obtained from github)
./configure
make all
make check
NOTE: No need to install wolfmqtt.
Since the broker and subscriber are still running, you can use mqttclient to publish using post-quantum algorithms in TLS 1.3 by doing the following:
./examples/mqttclient/mqttclient -T -h 174.18.0.2 -p 8883 -t -A CA.crt -K publisher.key -c publisher.crt -m "Hello from post-quantum wolfMQTT" -n test/sensor1 -Q SecP384r1MLKEM768
Congratulations! You have just published an MQTT message using TLS 1.3 with ML-KEM-768 hybridized with ECDHE on the P-384 curve and ML-DSA-65 signature scheme. To use only ML-KEM-768, replace SecP384r1MLKEM768 with ML_KEM_768. Moreover, you have also shown interoperability with liboqs, liboqs-provider, openssl3 and mosquitto.
Latest version combination tested: - wolfSSL: v5.8.2-stable - wolfMQTT: v1.20.0 - oqs-demos: commit 29d4dccbd547a62e8ba77d3fef1af5d6f8625d60
wolfMQTT now supports using libcurl's easy socket interface as a backend.
When enabled, wolfMQTT will use the libcurl API for the socket backend,
and libcurl will use wolfSSL to negotiate TLS.
This can be enabled with --enable-curl.
At this time wolfMQTT's libcurl option supports both TLS and mTLS, but not Post-Quantum TLS.
To use wolfMQTT with libcurl and wolfSSL:
--enable-curl and install to /usr/local.--with-wolfssl and install to /usr/local.Finally, build wolfMQTT with --enable-curl.
The --enable-curl option works with these combinations:
--enable-mt--enable-nonblock--enable-tls (default enabled)--enable-timeout (default enabled)However --enable-curl is incompatible and not supported with these options:
--enable-all--enable-snTo simplify testing a stress build option has been added, --enable-stress=[args].
The Stress option enables multithreading and nonblocking, and adds defines for
TEST_NONBLOCK, NUM_PUB_TASKS, and NUM_PUB_PER_TASK.
Examples of usage:
--enable-stress: stress with default options.--enable-stress=t7,p8: stress with 7 threads, and 8 publishes per thread.--enable-stress=t7,p8 --enable-curl: same as above, but with curl backend.Note: When stress is enabled, the Multithread Example becomes localhost only
and will not connect to remote servers. Additionally the test scripts/stress.test
is added to make check, and all other tests are disabled.
wolfMQTT includes a lightweight MQTT broker suitable for embedded and resource-constrained environments. It serves both MQTT v3.1.1 and v5.0 clients, with optional TLS, WebSocket transport, and encrypted persistence.
./configure --enable-broker
make
./src/mqtt_broker -p 1883
See BROKER.md for the full feature list, command-line options, build options, static-memory tuning, and persistence/encryption details.
wolfMQTT supports MQTT over WebSockets, allowing clients to connect to MQTT brokers through WebSocket endpoints. This is useful for environments where traditional MQTT ports might be blocked or when integrating with web applications.
Both standard WebSockets and secure WebSockets (WSS) are supported.
To build wolfMQTT with WebSocket support:
# On Debian/Ubuntu
sudo apt-get install libwebsockets-dev
# On macOS with Homebrew
brew install libwebsockets
./configure --enable-websocket
Note: You can also build wolfSSL with --enable-opensslcoexist (to support both OpenSSL and wolfSSL in the same build) if you encounter any conflicts.
make
The WebSocket client example is located in /examples/websocket/. This example demonstrates how to connect to an MQTT broker using WebSockets. The example subscribes to the topic "test/topic" and waits for incoming messages.
To run the example:
./examples/websocket/websocket_client [-h host] [-p port] [-t]
By default, it connects to localhost on port 8080.
wolfMQTT also supports secure WebSockets (WSS), which use TLS to encrypt the WebSocket connection.
To use secure WebSockets:
./configure --enable-websocket --enable-tls
./examples/websocket/websocket_client -t -p 8081
./examples/websocket/websocket_client -t -p 8081 -A /path/to/ca-cert.pem
./examples/websocket/websocket_client -t -p 8081 -A /path/to/ca-cert.pem --cert /path/to/client-cert.pem --key /path/to/client-key.pem
cmake .. -DLWS_WITH_WOLFSSL=1 -DLWS_WOLFSSL_INCLUDE_DIRS=/usr/local/include/wolfssl -DLWS_WOLFSSL_LIBRARIES=/usr/local/lib/libwolfssl.so -DLWS_WITH_EXTERNAL_POLL=1 -DCMAKE_BUILD_TYPE=DEBUG ..
This option requires wolfSSL to be built with ./configure --enable-libwebsockets --enable-alpn and installed to /usr/local.
To use the WebSocket example, your MQTT broker must be configured to support WebSockets. For Mosquitto, add the following to your mosquitto.conf:
# WebSocket settings
listener 8080
protocol websockets
For Secure WebSocket Support, add:
# Secure WebSocket
listener 8081
protocol websockets
cafile <path-to>/ca-cert.pem
# Path to the PEM encoded server certificate.
certfile <path-to>/server-cert.pem
# Path to the PEM encoded keyfile.
keyfile <path-to>/server-key.pem
Then restart Mosquitto with this configuration:
mosquitto -c mosquitto.conf
There is an example mosquitto configuration file in the websocket folder:
<wolfMQTT>$ mosquitto -c examples/websocket/mosq_ws.conf
You can also build the mosquitto broker to use wolfSSL for the TLS connection: https://github.com/wolfSSL/osp/tree/master/mosquitto
The WebSocket implementation uses libwebsockets as the backend and provides custom network callbacks for the MQTT client:
NetWebsocket_Connect: Establishes a WebSocket connection to the brokerNetWebsocket_Read: Reads data from the WebSocket connectionNetWebsocket_Write: Writes data to the WebSocket connectionNetWebsocket_Disconnect: Closes the WebSocket connectionThe example also implements a ping mechanism to keep the WebSocket connection alive, sending a ping to the broker every 30 seconds.
You can test the wolfMQTT client against public brokers supporting websockets:
Mosquitto unencrypted
./examples/websocket/websocket_client -h test.mosquitto.org -p8080
Mosquitto secure websocket
./examples/websocket/websocket_client -h test.mosquitto.org -p8081 -t
HiveMQ unencrypted
./examples/websocket/websocket_client -h broker.hivemq.com -p8000
HiveMQ secure websockets
./examples/websocket/websocket_client -h broker.hivemq.com -p8884 -t
wolfSSL/wolfMQTT is a public repo on GitHub by wolfSSL. wolfMQTT is a small, fast, portable MQTT client implementation, including support for TLS 1.3.
It declares the GPL-3.0 license on GitHub.
Its maker has not tagged a system, so it is unknown here. Its README says what it needs.
Open "Take it" on its page: Take My Repo writes an install plan for your machine and hands it to your AI agent (Claude Code, Codex or Cursor), which asks you before each step. Take My Repo has not tested it on any machine.
Its last change on GitHub was on 2026-11-22. Take My Repo does not judge from that whether it is maintained.
Nobody has reviewed it on Take My Repo yet, which says nothing about its quality.
:house_with_garden: Open source home automation that puts local control and privacy first.
Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Reverse engineer anything with agents, from app behavior down to native binaries.

A list of Free Software network services and web applications which can be hosted on your own servers
The wolfSSL library is a small, fast, portable implementation of TLS/SSL for embedded devices to the cloud. wolfSSL supports up to TLS 1.3 and DTLS 1.3! Update to wolfSSL 5.9.1 for the latest CVE fixes.
wolfBoot is a portable, OS-agnostic, secure bootloader for microcontrollers, supporting firmware authentication and firmware update mechanisms.
wolfSSH is a small, fast, portable SSH implementation, including support for SCP and SFTP.
wolfTPM is a highly portable TPM 2.0 library, designed for embedded use.
Example applications using the wolfSSL lightweight SSL/TLS library
This page is also available as structured data, with the same sources and dates.
/api/v1/resources/gh/wolfSSL/wolfMQTTTake My Repo has not tested this on your machine. Requirements come from the project's own documentation.