21#include <compy/priv/compiler_attrs.h>
TLS configuration.
Definition tls.h:26
const char * key_path
Path to PEM private key file.
Definition tls.h:28
const char * cert_path
Path to PEM certificate file.
Definition tls.h:27
Compy_Writer compy_tls_writer(Compy_TlsConn *conn) COMPY_PRIV_MUST_USE
Creates a Compy_Writer backed by a TLS connection.
Definition tls.c:193
int Compy_TlsContext_set_cipher_preference(Compy_TlsContext *ctx, Compy_TlsCipherPreference pref)
Sets the ciphersuite preference for all connections accepted through this context.
Definition tls.c:46
void Compy_TlsConn_free(Compy_TlsConn *conn)
Frees per-connection TLS state.
Definition tls.c:112
ssize_t compy_tls_read(Compy_TlsConn *conn, void *buf, size_t len) COMPY_PRIV_MUST_USE
Reads decrypted data from a TLS connection.
Definition tls.c:89
Compy_TlsCipherPreference
TLS ciphersuite preference presets.
Definition tls.h:63
@ COMPY_TLS_CIPHER_DEFAULT
Backend defaults (typically GCM-first in TLS 1.3).
Definition tls.h:65
@ COMPY_TLS_CIPHER_CHACHA20_ONLY
TLS 1.3: allow only CHACHA20-POLY1305-SHA256.
Definition tls.h:81
Compy_TlsContext * Compy_TlsContext_new(Compy_TlsConfig config) COMPY_PRIV_MUST_USE
Creates a new TLS context from configuration.
Definition tls.c:19
void Compy_TlsContext_free(Compy_TlsContext *ctx)
Frees a TLS context.
Definition tls.c:39
Compy_TlsConn * Compy_TlsConn_accept(Compy_TlsContext *ctx, int fd) COMPY_PRIV_MUST_USE
Performs server-side TLS handshake on fd.
Definition tls.c:63
int compy_tls_shutdown(Compy_TlsConn *conn)
Shuts down the TLS connection gracefully.
Definition tls.c:102