S6-TLSC(8)
π s6-tlsc β the client-side TLS glow-up for your boring cleartext app β¨
okay so real talk: s6-tlsc is a page from the System Manager's Manual, and it's about establishing a TLS or SSL client connection over a TCP connection you already have open, then exec'ing into an application. it's giving "security blanket for apps that never learned to speak TLS" π
πΈ SYNOPSIS πΈ
s6-tlsc [-S | -s] [-J | -j] [-Y | -y] [-Z | -z] [-v verbosity]
[-K kimeout] [-k servername] [-6 rfd] [-7 wfd] [--] prog...
β¨ DESCRIPTION β¨
so like, s6-tlsc exists to make network comms secure even for applications that do not natively support TLS/SSL. bestie, it's a whole vibe β your app doesn't need to know anything about certificates, the wrapper handles it π
s6-tlsc expects to already have an open TCP connection it can talk to on its descriptors β by default 6 (for reading) and 7 (for writing).
it spawns an s6-tlsc-io(8) child process, and that child is the one that initiates the TLS connection, performs the handshake (expecting a TLS server on the other side of the network) and maintains the TLS tunnel. main character energy fr π«Ά
then, when s6-tlsc-io(8) notifies it that the handshake has completed, s6-tlsc exec(3)s into prog.... no cap, that's it, that's the whole trick.
the goal of the s6-tlsc interface (and its server-side companion s6-tlsd(8)) is genuinely iconic: if you have a client run by the command line client... that speaks a cleartext protocol to a server run by the command line server..., and the server has the proper private key and certificate, and the client has the proper list of trust anchors β then you can literally just change the client command line to s6-tlsc client... and the server command line to s6-tlsd server... without changing the client or the server themselves, and the communication between them will be secure. periodt. π
π₯ OPTIONS π₯
-v verbosityβ be more or less verbose. default for verbosity is1.0is quiet,2is verbose, more than2is debug output. β οΈ heads up: this option currently has no effect. (yes really, it's just sitting there being cute π)-Zβ do not clean the environment of the variables used bys6-tlsc-io(8)beforeexec(3)'ingprog....-zβ clean the environment of the variables used bys6-tlsc-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-tlsc-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β do not send a client certificate. this is the default.-yβ send a client certificate.-k servernameβ use Server Name Indication, and send servername. the default is not to use SNI, which may be a security risk π¬ (not me leaving that flag offβ¦)-K kimeoutβ if the handshake takes more than kimeout milliseconds to complete, close the connection. the default is0, which means infinite timeout (never kill the connection).-6 rfdβ expect an open file descriptor numbered rfd to read network (ciphertext) data from. make sureprogalso reads its data from its own fd rfd. default is6.-7 fdwβ expect an open file descriptor numbered fdw to write network (ciphertext) data to. make sureprogalso writes its data to its own fd fdw. default is7.
π¦ ENVIRONMENT π¦
π Read
s6-tlsc does not expect to have any particular environment variables, but it spawns an s6-tlsc-io(8) program that does. so it should pay attention to the following variables:
CADIRorCAFILE- (if the
-yoption has been given)CERTFILEandKEYFILE TLS_UIDandTLS_GID
π Written
by default, prog... is run with all these variables unset: CADIR, CAFILE, KEYFILE, CERTFILE, TLS_UID and TLS_GID. they're passed to the s6-tlsc-io(8) child but not to prog.... the -Z option prevents that behaviour.
however, prog... is run with the following additional environment variables, and they're lowkey the good part:
SSL_PROTOCOLβ contains the protocol version:TLSv1,TLSv1.1,TLSv1.2...SSL_CIPHERβ contains the name of the cipher used.SSL_TLS_SNI_SERVERNAMEβ contains servername, if the-koption has been given; otherwise it is removed from the environment.SSL_PEER_CERT_HASHβ contains the hash of the peer's End Entity certificate, prefixed by the name of the hash and a colon (typicallySHA256:).SSL_PEER_CERT_SUBJECTβ contains the decodedsubjectDNof the peer's End Entity certificate, i.e. identifying information. what is traditionally called the βnameβ of the certificate is the CN field in that data. iykyk π
more similar environment variables containing information about the connection may be added in the future. so like, stay tuned bestie β
π EXIT STATUS π
100β wrong usage. (you did too much π)111β system call failed.
if everything goes smoothly, s6-tlsc does not exit, but exec(3)s into prog... instead. slay π
π SEE ALSO π
s6-tls(7), s6-tlsc-io(8), s6-tlsclient(8), s6-tlsd(8), s6-tlsd-io(8), s6-tlsserver(8), s6-ucspitlsc(8), s6-ucspitlsd(8)
this man page is ported from the authoritative documentation at: https://skarnet.org/software/s6-networking/s6-tlsc.html
π AUTHORS π
- Laurent Bercot
- Alexis
<flexibeast@gmail.com>(man page port)
and that's the whole thing, bestie π§π this one's from the Debian fam, dated November 20, 2023 β go forth and wrap literally everything in TLS, you absolute icon πΈπ¦β¨
π¦ 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