SharkSSL C/C++ Reference
TLS, cryptography, certificates, and PSA integration
Application protocols

SharkSSL delivers these application protocol stacks as examples in the examples/ directory. Each uses the SharkSSL socket example library (selib) for network I/O. Choose a protocol below to find its API and a program that uses it.

Protocol and API What you can do Start with
MQTT client (SharkMQTT) Publish messages to an MQTT 3.1.1 broker and subscribe to topics. Chat-MQTT.c
SMQ client (SharkMQ) Connect a device to a SimpleMQ broker so browsers and devices can exchange messages. LED-SMQ.c
WebSocket client Open a connection to a WebSocket server and exchange frames. WsEchoClient.c
HTTP and WebSocket server (Minnow Server) Serve a web page from a device and accept a WebSocket connection from the browser. WsChatServer.c
SMTP client Send email through a mail server using implicit TLS or STARTTLS. SMTP-example.c and SMTP-example.cpp

Build a protocol example

  1. Start with the example for your protocol. Its API page identifies the header to include and the library source to compile. The Windows example projects are in build/VC-Win/examples.sln.
  2. Build the selected library with examples/selib.c and link SharkSSL. Add examples/ and the matching examples/arch/<port>/ directory to your include path so selib.h finds the target's selibplat.h. Include any implementation files required by that port. The RTOS and TCP/IP port table gives the include directories and socket sources for common board configurations.
  3. For a TLS client, configure the intended server name and trusted certificate authorities. See CertCheck.c for server authentication and example RNG setup for the entropy requirements.

The socket API covers TCP connections and TLS reads and writes. Event-driven bare-metal ports also use the SeCtx context manager. The example program license is in examples/LICENSE.txt.