TLS_CLIENT(3)
π tls_client(3) β Library Functions Manual π
okay bestie, welcome to the tls_client(3) page, you're gonna eat this up β¨
π NAME π
tls_client, tls_server, tls_configure, tls_reset, tls_free β configure a TLS connection
πΈ SYNOPSIS πΈ
#include <tls.h>
struct tls *
tls_client(void);
struct tls *
tls_server(void);
int
tls_configure(struct tls *ctx, struct tls_config *config);
void
tls_free(struct tls *ctx);
void
tls_reset(struct tls *ctx);
π¦ DESCRIPTION π¦
so like. a TLS connection is literally just a struct tls object, and we call it a βcontextβ. that's the whole vibe. π
you make a brand new context with either tls_client() or tls_server(). tls_client() is the one for TLS client programs, tls_server() is for TLS server programs. pick your fighter, no cap.
then you configure that context with tls_configure(). and here's the cute part β the same tls_config object can be used to configure multiple contexts. like one config, many contexts, iconic behavior honestly. π
after it's configured, tls_connect(3) can be called on the objects that came from tls_client(), and tls_accept_socket(3) on the ones from tls_server(). β¨
after you're done using it, a TLS context should be closed with tls_close(3), and then freed by calling tls_free(). and listen β if you call tls_free() with an argument of NULL, no action occurs. it's just chillin, nothing happens, no drama. π«Ά
also you can reset a TLS context by calling tls_reset(), which lets you reuse it. it's essentially equivalent to calling tls_free() and then calling the same function that was originally used to allocate the TLS context. so like, recycle era. π
β RETURN VALUES β
tls_client()andtls_server()returnNULLon error or an out of memory condition. πtls_configure()returns0on success or-1on error.
π SEE ALSO π
tls_accept_socket(3), tls_config_new(3), tls_connect(3), tls_init(3)
π HISTORY π
these functions appeared in OpenBSD 5.6 and got their final names in OpenBSD 5.7. glow up fr fr. β¨
π AUTHORS π
Joel Sing <jsing@openbsd.org>
mwah π that's the whole page bestie, go configure something gorgeous. π§
Debian Β· August 12, 2017 Β· TLS_CLIENT(3) β ty for reading, ily, periodt π
π¦ where this page comes from
- alpine 3.22: libretls-doc 3.7.0-r2 Β· ISC AND ( BSD-3-Clause OR MIT )
- alpine 3.24: libretls-doc 3.8.1-r0 Β· ISC AND ( BSD-3-Clause OR MIT )
- arch rolling: libretls 3.8.1-3 Β· ISC AND BSD AND MIT
- debian bookworm: libtls-dev 3.7.0-4
- debian trixie: libtls-dev 3.8.1-2.1+b2
- epel 10: libretls-devel 3.8.1-4.el10_0 Β· ISC AND BSD-3-Clause AND MIT AND LicenseRef-Fedora-Public-Domain
- epel 9: libretls-devel 3.8.1-1.el9 Β· ISC AND BSD-3-Clause AND MIT AND LicenseRef-Fedora-Public-Domain
- fedora 43: libretls-devel 3.8.1-6.fc43 Β· ISC AND BSD-3-Clause AND MIT AND LicenseRef-Fedora-Public-Domain
- fedora 43: libretls-devel 3.8.1-6.fc43 Β· ISC AND BSD-3-Clause AND MIT AND LicenseRef-Fedora-Public-Domain
- fedora 44: libretls-devel 3.8.1-7.fc44 Β· ISC AND BSD-3-Clause AND MIT AND LicenseRef-Fedora-Public-Domain
- fedora 44: libretls-devel 3.8.1-7.fc44 Β· ISC AND BSD-3-Clause AND MIT AND LicenseRef-Fedora-Public-Domain
- nixos 26.05: libretls 3.8.1
- nixpkgs unstable: libretls 3.8.1
- ubuntu jammy: libtls-dev 3.4.1-2build1
- ubuntu noble: libtls-dev 3.8.1-2.1build2
- ubuntu questing: libtls-dev 3.8.1-2.1build2
- ubuntu resolute: libtls-dev 3.8.1-2.1build3
- ubuntu stonking: libtls-dev 3.8.1-2.1build4
- Copyright (c) 2014 Ted Unangst <tedu@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms