Skip to content

OpenSSL platform

«interface»SolidSyslogStreamOpenSslStreamOpenSsl«interface»SolidSyslogStream

File SolidSyslogOpenSslStream.h

FileList > Interface > SolidSyslogOpenSslStream.h

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

Classes

Type Name
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 cert-rotation contract — a reconnect re-reads the cert/key files), pins the TLS 1.2 floor, loads CaBundlePath as the trust anchors with SSL_VERIFY_PEER, wires the transport as a custom BIO, sets SNI + the expected peer identity from 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 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
) 

An exhausted pool (default size 1) falls back to the shared NullStream.


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