S6-UCSPITLSD(8)
π s6-ucspitlsd(8) π
okay bestie, this is the s6-ucspitlsd page from the System Manager's Manual (section 8), and it's literally the server-side bestie that sets up UCSPI-TLS channels then execs into your app. periodt.
πΈ NAME πΈ
s6-ucspitlsd β server-side program that establishes communication channels according to the UCSPI-TLS protocol, then execs into an application. slay.
β¨ SYNOPSIS β¨
s6-ucspitlsd [-S | -s] [-J | -j] [-Y | -y] [-Z | -z] [-v verbosity]
[-K kimeout] [-k snilevel] [--] prog...
π¦ DESCRIPTION π¦
If the application sends a command, a TLS tunnel will be started and the application will be able to use it instead of communicating with the network via cleartext. no cap, that's the whole vibe.
The point of this protocol, and this program, is to make it easy to implement commands like SMTP's STARTTLS without embedding a TLS stack in the server itself. iconic, honestly.
s6-ucspitlsd expects to have an open TCP connection it can talk to on its stdin and stdout.
It forks and establishes communication channels between the parent and the child. The parent executes into prog...; the child remains and waits for a command.
At any time, prog... can send a command to its control socket provided by s6-ucspitlsd, following the UCSPI-TLS[1] protocol. Then the s6-ucspitlsd child will exec into an s6-tlsd-io(8) process that will initialize the TLS connection, perform the handshake (expecting a TLS client on the other side of the network) and maintain a TLS tunnel. prog can use that TLS tunnel instead of talking directly to the network.
It only makes sense to run s6-ucspitlsd if its application program prog knows and understands the UCSPI-TLS[1] protocol for opportunistic TLS. If it does not, you will not be able to secure your connection, and what you need is a regular immediate TLS program instead, which means s6-tlsd(8).
π OPTIONS π
-v verbosityβ be more or less verbose. Default forverbosityis1.0is quiet,2is verbose, more than2is debug output. choose your fighter.-Zβ do not clean the environment of the variables used bys6-tlsc-io(8)beforeexec(3)'ingprog.... yep, that'ss6-tlsc-io(8), bestie, keep it exact.-zβ clean the environment of the variables used bys6-tlsd-io(8)beforeexec(3)'ingprog.... this is the default.-Sβ send aclose_notifyalert and break the connection whenprogsends EOF.-sβ transmit EOF by half-closing the TCP connection without usingclose_notify. this is the default.-Jβ makes6-tlsd-io(8)exit with a nonzero code if the peer sends EOF without aclose_notifyfirst.-jβ treat EOF from the peer as a normal exit condition.-Yβ request an optional client certificate.-yβ request a mandatory client certificate. The default, with neither the-Ynor the-yoption, is not to request a client certificate at all.-K kimeoutβ close the connection if the handshake takes more thankimeoutmilliseconds to complete. The default is0, which means infinite timeout: let the handshake complete at its own pace, no matter how slow. take your time, king.-k snilevelβ support alternative certificate chains for SNI. Ifsnilevelis nonzero, private key file names are read from every environment variable of the formKEYFILE:x, wherexis a server name that the client may require, and a corresponding certificate chain for the namexshould exist in the file named after the contents of theCERTFILE:xenvironment variable. Ifsnilevelis2or more, only those files are read, and the genericKEYFILEandCERTFILEvariables are ignored. Ifsnilevelis0, or if the option is not given, which is the default,KEYFILEandCERTFILEare the only private key / certificate chain pair that are loaded, no other environment variable is read for keypairs. that's the whole SNI multiverse situation.
π ENVIRONMENT π
π Read
s6-ucspitlsd does not expect to have any particular environment variables, but it spawns a s6-tlsd-io(8) program that does. So it should pay attention to the following variables:
CERTFILEandKEYFILE. Also (or alternatively), if the-koption is given: a series ofKEYFILE:xandCERTFILE:xvariables, for everyxin the set of server names.- (If the
-Yor-yoption has been given)CADIRorCAFILE. TLS_UIDandTLS_GID.
βοΈ Written
By default, prog... is run with all these variables unset: CADIR, CAFILE, KEYFILE, CERTFILE, KEYFILE:x and CERTFILE:x for every x, TLS_UID and TLS_GID. The variables are passed to the s6-tlsd-io(8) child but not to prog.... The -Z option prevents that behaviour and keeps them accessible in the child.
However, prog... is run with the following additional environment variables, following the UCSPI-TLS protocol:
SSLCTLFDβ contains the file descriptor number of the control socket.SSLREADFDβ contains the file descriptor number of the pipe used to read data from the TLS tunnel after it has been activated.SSLWRITEFDβ contains the file descriptor number of the pipe used to write data to the TLS tunnel after it has been activated.
Since prog is exec(3)'ed before the TLS handshake takes place, it cannot get information about the TLS connection via environment variables. However, if it starts the TLS connection via a Y command (as opposed to a y command), it will receive this information as a string sent over the control socket. iykyk.
π EXIT STATUS π
100β wrong usage.111β system call failed.
Normally the parent s6-ucspitlsd process exec(3)s into prog... and the child process execs into s6-tlsd-io(8). If the parent dies or closes its control socket before sending a command to start TLS, the child exits 0.
π«Ά SEE ALSO π«Ά
s6-tls(7)s6-tlsc(8)s6-tlsc-io(8)s6-tlsclient(8)s6-tlsd(8)s6-tlsd-io(8)s6-tlsserver(8)s6-ucspitlsc(8)- [1]
https://web.archive.org/web/20150311223933/http://www.suspectclass.com/sgifford/ucspi-tls/ucspi-tls.txt
This man page is ported from the authoritative documentation at: https://skarnet.org/software/s6-networking/s6-ucspitlsd.html
π AUTHORS π
- Laurent Bercot
- Alexis <flexibeast@gmail.com> (man page port)
okay that's the whole s6-ucspitlsd(8) situation, bestie β Debian, November 20, 2023 β byeee π
π
π¦ 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