File SolidSyslogWolfSslStream.h¶
FileList > Interface > SolidSyslogWolfSslStream.h
#include "SolidSyslogExternC.h"#include "SolidSyslogSleep.h"#include "SolidSyslogStream.h"#include "SolidSyslogTlsHandshakeTimeoutFunction.h"
Classes¶
| Type | Name |
|---|---|
| struct | SolidSyslogWolfSslProfile What one connection is made with, supplied by the integrator at each Open. |
| struct | SolidSyslogWolfSslStreamConfig Wires SolidSyslogWolfSslStream to its transport, trust anchors, and identity. |
Detailed Description¶
TLS over an injected byte-transport Stream via wolfSSL, itself a Stream - so a StreamSender speaks TLS to a remote collector without knowing the transport underneath, whether a TCP stream from a platform pack or one the caller supplies.
What the stream does through its vtable is the substance:
- Open first opens the underlying transport, builds a client context for this connection, asks the credentials source to install the material onto it, creates the session, applies the library-owned TLS policy (TLS 1.2 floor, the BCP 195 section 4.5 key-size floors, a required peer certificate), installs the peer identity, then drives the handshake to completion. The non-blocking transport means each wolfSSL_connect may want more I/O; the injected Sleep bridges those polls until the handshake completes, hits a hard error (HANDSHAKE_REJECTED, or the check the peer failed), or the bounded budget expires (HANDSHAKE_TIMEOUT - re-read from GetHandshakeTimeoutMs each attempt, so a runtime-tunable value applies on the next reconnect). A failed Open closes the stream so the sender reconnects on its next pass.
- Send is all-or-nothing: a short write or any TLS error is taken as an unrecoverable session and closes the stream, so the sender reconnects.
- Read returns the bytes read, 0 for would-block, or closes the stream on any other TLS return (alert, transport error) - fail-fast, and store-and-forward replays after the reconnect.
Peer identity comes from the profile's ServerName, asked for at each Open. No key material reaches this stream: it asks its credentials source to install onto the context at Open and tells it at Close, so a deployment can keep material out of memory between connections. The context and the session are both built per connection and freed at Close, so nothing of one connection survives into the next. Coexistence contract: this adapter calls no process-global wolfSSL API (wolfSSL_Init, wolfSSL_Cleanup, debugging hooks); the integrator initialises the library once, as docs/platforms/wolfssl/setup.md says.
Public Types Documentation¶
SolidSyslogWolfSslProfileFunction¶
Called at each Open to fill profile .
typedef void(* SolidSyslogWolfSslProfileFunction) (struct SolidSyslogWolfSslProfile *profile, void *context);
Runs on the servicing thread, so a value the integrator changes elsewhere is read here rather than stored, and moving the stream's Version is what makes the change take effect. context is ProfileContext, passed through unchanged.
Public Functions Documentation¶
SolidSyslogWolfSslStream_Create¶
Draw a TLS stream from the pool over the config's Transport (see the file overview for the handshake and I/O behaviour).
struct SolidSyslogStream * SolidSyslogWolfSslStream_Create (
const struct SolidSyslogWolfSslStreamConfig * config
)
A NULL config, a NULL Transport, a NULL Sleep or a NULL Credentials is reported and falls back to the shared NullStream, as does an exhausted pool.
SolidSyslogWolfSslStream_Destroy¶
Release the pool slot; closes the TLS session and the underlying transport if the stream is still open.
The documentation for this class was generated from the following file Platform/WolfSsl/Interface/SolidSyslogWolfSslStream.h