Skip to content

OpenSSL platform

«interface»SolidSyslogStreamOpenSslStreamOpenSsl«interface»SolidSyslogStream«interface»SolidSyslogOpenSslCredentials

File SolidSyslogOpenSslStream.h

FileList > Interface > SolidSyslogOpenSslStream.h

  • #include "SolidSyslogExternC.h"
  • #include "SolidSyslogSleep.h"
  • #include "SolidSyslogStream.h"
  • #include "SolidSyslogTlsHandshakeTimeoutFunction.h"

Classes

Type Name
struct SolidSyslogOpenSslProfile
What one connection is made with, supplied by the integrator at each Open.
struct SolidSyslogOpenSslStreamConfig
Wires SolidSyslogOpenSslStream to its transport, trust anchors, and identity.

Detailed Description

TLS over an injected byte-transport Stream (OpenSSL reference integration), for a StreamSender that needs an encrypted channel.

The transport (a plain TcpStream, typically) carries the ciphertext; this stream owns the TLS.

What the stream does through its vtable is the substance:

  • Open opens the transport, then builds a fresh SSL_CTX every call (the rotation contract - nothing survives a reconnect), pins the TLS 1.2 floor, asks its credentials source to install the trust anchors, any pinned fingerprints and the client credential, sets SSL_VERIFY_PEER, wires the transport as a custom BIO, sets SNI + the expected peer identity from the profile's ServerName, and drives the handshake. Any step failing closes the whole stream so the sender reconnects on its next pass.
  • The handshake is a bounded, non-blocking retry: SSL_connect is polled, and each WANT_READ / WANT_WRITE sleeps briefly via the injected Sleep until the handshake completes, hits a hard error (rejected), or the deadline from GetHandshakeTimeoutMs expires (re-read each attempt, so a runtime-tunable value applies on the next reconnect).
  • Send is all-or-nothing over SSL_write: a short write or any error is taken as a dead connection, so the stream closes itself and the sender reconnects.
  • Read returns the bytes read, 0 for would-block (WANT_READ, connection kept), or closes on anything else - including a mid-stream WANT_WRITE (renegotiation) which fail-fast semantics treat as a transport failure; store-and-forward replays after the reopen.

Public Types Documentation

SolidSyslogOpenSslProfileFunction

Called at each Open to fill profile .

typedef void(* SolidSyslogOpenSslProfileFunction) (struct SolidSyslogOpenSslProfile *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

SolidSyslogOpenSslStream_Create

Draw a TLS stream from the pool over the injected transport (see the file overview for the handshake and I/O behaviour).

struct SolidSyslogStream * SolidSyslogOpenSslStream_Create (
    const struct SolidSyslogOpenSslStreamConfig * 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 (default size 1).


SolidSyslogOpenSslStream_Destroy

Release the pool slot; closes the TLS session and the underlying transport first if the stream is still Open.

void SolidSyslogOpenSslStream_Destroy (
    struct SolidSyslogStream * base
) 



The documentation for this class was generated from the following file Platform/OpenSsl/Interface/SolidSyslogOpenSslStream.h