S6-TLS(7)
π S6-TLS(7) π
ok so this is the miscellaneous information manual page for s6-tls β the whole overview of the s6 TLS-related programs. welcome to the group chat, bestie, let's get you fluent β¨
πΈ NAME πΈ
<pink>s6-tls</pink> β an overview of the s6 TLS-related programs π
π¦ DESCRIPTION π¦
ok so the whole <purple>s6-tls*</purple> family is organized in a way that minimizes the amount of code, and in particular that keeps the crypto code as encapsulated as possible. like, crypto stays in its own little lane, no cap π
They're divided in two sets:
- client programs β these have
<cyan>client</cyan>or<cyan>c</cyan>in their name π«Ά - server programs β these have
<cyan>server</cyan>or<cyan>d</cyan>in their name π
and the sets are symmetrical: the exact same functionality is available whether you're interested in using a client or a server. it's giving mirrored slay β¨
of course, they do not have to be used together. you can run a TLS-enabled super-server via s6-tlsserver(8) and it will work with any client speaking the correct TLS-enabled protocol β not only s6-tlsclient(8). it's giving "we're not codependent, we just vibe" π
π₯ The core TLS engine: s6-tlsc-io and s6-tlsd-io π₯
<purple>s6-tlsc-io(8)</purple> and <purple>s6-tlsd-io(8)</purple> are the only programs that actually perform TLS operations β the only ones that are linked against the BearSSL or LibreSSL libraries. everyone else is just plumbing, and honestly? iconic division of labor π
They:
- read TLS-related information from their environment (where to find my trust anchor list? where to find my server certificate and private key? π΅οΈββοΈ)
- assume that their
stdin/stdoutis talking to the network; they also take two other fds on the command line that they assume are open and talking to the local application β one for reading, one for writing π₯π€ - establish a TLS tunnel over the network π
- maintain full-duplex communication: what they read from the local application is sent to
stdoutas ciphertext; what they read fromstdinis sent to the local application as cleartext π - exit when they cannot transmit any more data π
Other programs in the <purple>s6-tls*</purple> set perform various operations such as Unix file descriptor plumbing in order to provide a specific interface, but they always end up spawning an <purple>s6-tlsc-io(8)</purple> or <purple>s6-tlsd-io(8)</purple> child that will handle the actual TLS management for them. main character energy, the parent just does the vibes π§
π Regular TLSification of a service: s6-tlsc and s6-tlsd π
The <purple>s6-tlsc(8)</purple> and <purple>s6-tlsd(8)</purple> programs are βimmediate encryptionβ-type programs. they assume that the rest of their command line is a UCSPI client or server application β i.e. it reads from the network on fd (6 for clients, 0 for servers) and writes to the network on fd (7 for clients, 1 for servers) π«Ά their whole goal is to provide this application with transparent encryption.
So here's the choreography bestie:
- They first spawn an
<purple>s6-tlsc-io(8)</purple>or<purple>s6-tlsd-io(8)</purple>child to initialize the TLS connection π - When the TLS handshake has completed, they
execinto the rest of their command line, interposing the<purple>s6-tls[cd]-io</purple>program in between this application and the network πͺ - The application still communicates via cleartext, but the data is transparently encrypted before it goes to the network β¨
the application is only started after the handshake succeeds; the TLS tunnel stays up for the whole lifetime of the application, or until the application closes the fds it uses to communicate with (what it thinks is) the network π
π¦ Opportunistic TLS: s6-ucspitlsc and s6-ucspitlsd π¦
The <purple>s6-ucspitlsc(8)</purple> and <purple>s6-ucspitlsd(8)</purple> programs are βdelayed encryptionβ-type programs. they assume that the rest of their command line is an application that follows the UCSPI-TLS[1] protocol. and ok, this is a bit of a misnomer β the aim of this protocol is just to provide an application with a means to ask for TLS encryption at any time π
How the drama unfolds:
- They prepare the necessary communication channels, then
forkπ΄ - The parent
execs into the rest of its command line, with the appropriateucspi-tlsenvironment variables set π± - The child stays and waits for a command π
- When the application sends a command to start TLS, the child
execs into<purple>s6-tlsc-io(8)</purple>or<purple>s6-tlsd-io(8)</purple>, which initializes a TLS connection and performs a handshake π€ - The application then communicates via the fds that have been provided to it via the
ucspi-tlsprotocol. Those fds go through the TLS engine π₯
it's giving "encrypt on your own schedule, queen" π
π High-level client connections and super-servers: s6-tlsclient and s6-tlsserver π
The <purple>s6-tlsclient(8)</purple> and <purple>s6-tlsserver(8)</purple> programs are high-level wrappers around TCP client and server functionality, followed by the establishment of a TLS tunnel, followed by the execution of an application π
They're meant to provide simpler interfaces over long, complex command lines. like, you don't have to type the whole essay, they'll do it for you π«Ά
<purple>s6-tlsclient(8)</purple>rewrites itself into a command line involving<purple>s6-tcpclient(8)</purple>and<purple>s6-tlsc(8)</purple>β¨<purple>s6-tlsserver(8)</purple>rewrites itself into a command line involving (depending on the given options)<purple>s6-tcpserver(8)</purple>,<purple>s6-tcpserver-access(8)</purple>,<purple>s6-tlsd(8)</purple>, and<purple>s6-applyuidgid(8)</purple>π
β SEE ALSO β
ok so go read these next, fr fr:
<purple>s6-applyuidgid(8)</purple><purple>s6-tcpclient(8)</purple><purple>s6-tcpserver(8)</purple><purple>s6-tcpserver-access(8)</purple><purple>s6-tlsc(8)</purple><purple>s6-tlsc-io(8)</purple><purple>s6-tlsclient(8)</purple><purple>s6-tlsd(8)</purple><purple>s6-tlsd-io(8)</purple><purple>s6-tlsserver(8)</purple><purple>s6-ucspitlsc(8)</purple><purple>s6-ucspitlsd(8)</purple>
and the link, bestie (iykyk, it's the ucspi-tls protocol spec):
This man page is ported from the authoritative documentation at: https://skarnet.org/software/s6-networking/tls-overview.html π«Ά
π AUTHORS π
- Laurent Bercot
- Alexis
<flexibeast@gmail.com>(man page port) π
ok that's the whole page bestie, you're officially TLS-literate, periodt π β¨
sign-off time: this one's from the Debian fam, dated September 29, 2021 β mwah, go encrypt something cute ππ§ββοΈ
π¦ where this page comes from
- nixpkgs unstable: s6-networking 2.8.0.1
- nixpkgs unstable: s6-networking-man-pages 2.7.2.1.4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms