S6-TLSSERVER(8)
β¨ S6-TLSSERVER(8) β¨
okay bestie, buckle up β this is S6-TLSSERVER(8) and she is here to make TLS super-server stuff make sense π
π NAME π
s6-tlsserver β UCSPI server tool[1] for TLS/SSL connections over INET domain sockets π¦
πΈ SYNOPSIS πΈ
s6-tlsserver [options] [--] ip port prog...
π DESCRIPTION π
s6-tlsserver is a TCP super-server: it listens for connections, accepts them, and for each connection it establishes a TLS transport over it, then executes into a program. Iconic behavior, genuinely π«Ά
s6-tlsserver rewrites itself into a command line involving:
s6-tcpserver(8), which listens to TCP connections on IP address ip port port and forks a command line for every connection. Heads up:s6-tcpserver(8)also rewrites itself into a more complex command line (the final long-lived process beings6-tcpserverd(8)), so your end command line may look a lot longer inps(1)than what you originally wrote. This is normal and healthy. no cap β¨- (If applicable)
s6-tcpserver-access(8), which performs TCP access control and various operations on the TCP connection. s6-tlsd(8), which establishes a TLS transport (server-side) over a connection, via ans6-tlsd-io(8)child process.- (If applicable)
s6-applyuidgid(8), which drops root privileges. - prog..., your client program, which is run with the
s6-tlsd(8).
It runs until it is killed by a signal. π
prog is expected to read from its peer on its standard input and write to its peer on its standard output. Since there will be an s6-tlsd-io(8) program between prog and the network to perform the SSL encryption/decryption, those descriptors will not be a network socket β they will be pipes. lowkey important π§
π‘ Signals π‘
s6-tlsserver reacts to the same signals as s6-tcpserverd(8), which is the long-lived process hanging around. main character energy, honestly π
π OPTIONS π
s6-tlsserver accepts a myriad of options, most of which are passed as is to the correct executable. Not giving any options will generally work, but unless you're running a very public server (such as a Web server) or base your access control on client certificates, you probably still want TCP access rules. fr fr π
π
Options informing s6-tlsserver behaviour π
-Lβ if this option is given,s6-tlsserverwill add an invocation ofproxy-server(8)so that aPROXYline or binary block is read in cleartext before the TLS tunnel is established. If the proxy uses the v2 version of thePROXYprotocol and transmits SSL information from the client connection, this information will be reflected in the SSL environment variables transmitted to prog. π¦
π οΈ Options passed as-is to s6-tcpserver(8) π οΈ
-q,-Q,-vβ passed as-is tos6-tcpserver(8).-1β passed as-is tos6-tcpserver(8).-c maxconnβ passed as-is tos6-tcpserver(8).-C localmaxconnβ passed as-is tos6-tcpserver(8).-b backlogβ passed as-is tos6-tcpserver(8).
π Options passed as-is to s6-tcpserver-access(8) π
-v0,-v2β the verbosity level.-w,-Wβ be strict or tolerant with DNS or IDENT resolution errors.-d,-Dβ enable or disable Nagle's algorithm.-r,-Rβ enable or disable IDENT lookups.-p,-Pβ enable or disable paranoid DNS cross-checking.-Hβ disable DNS lookups.-hβ consult/etc/hostsbefore DNS.-l localnameβ get the local name from the command line, don't look it up.-B bannerβ initial server-side banner.-t timeoutβ set a timeout for all the lookups.-i rulesdir,-x rulesfileβ TCP access control.
π₯ Options passed as-is to s6-tlsd(8) π₯
-Z,-zβ keep or remove thes6-tlsd-io(8)-specific variables from the application's environment.-S,-sβ use βclose_notifyβ or EOF to signal the end of a TLS connection.-J,-jβ exit nonzero with an error message when the peer fails to βclose_notifyβ, or ignore it.-Y,-yβ request an optional or a mandatory client certificate.-K kimeoutβ set a timeout for the TLS handshake.-k snilevelβ support SNI-based certificate chains.
π Options passed to s6-applyuidgid π
-u uid,-g gid,-G gidlistβ set uid, gid, or supplementary group list.-U(passed as-Uz) β get the uid, gid and supplementary group list from theUID,GIDandGIDLISTvariables, and remove these variables from the application's environment.
π¦ ENVIRONMENT π¦
π Read π
The following variables should be set before invoking s6-tlsserver, because they will be used by every s6-tlsd(8) invocation:
KEYFILECERTFILETLS_UIDandTLS_GIβ if you runs6-tlsserveras root.CADIRβ if you want client certificates.CAFILEβ if you want client certificates, alternative toCADIR.
Setting both KEYFILE and CERTFILE is mandatory. periodt π
βοΈ Written βοΈ
prog... is run with the following variables added to, or removed from, its environment by s6-tcpserverd(8) and possibly by s6-tcpserver-access(8):
PROTOTCPREMOTEIPTCPREMOTEPORTTCPCONNNUMTCPLOCALIPTCPLOCALPORTTCPREMOTEHOSTTCPLOCALHOSTTCPREMOTEINFO
Depending on TCP access rules (if the -i or -x option has been given), it is possible that prog's environment undergoes more modifications. Also, since s6-tlsd(8) is always run after s6-tcpserver-access(8), it is possible to set different TLS/SSL parameters (typically a different KEYFILE and CERTFILE) depending on the client connection, by writing the correct set of TCP access rules. iykyk β¨
Unless the -Z option is given to s6-tlsserver, the CADIR, CAFILE, KEYFILE, CERTFILE, TLS_UID and TLS_GID variables will not appear in prog's environment. π«Ά
π§ͺ EXAMPLES π§ͺ
As root:
env KEYFILE=/etc/ssl/private/mykey.der CERTFILE=/etc/ssl/public/mycert.pem \
TLS_UID=65534 TLS_GID=65534 \
s6-envuidgid www \
s6-tlsserver -U -- 1.2.3.4 443 httpd
This will start a server listening to 1.2.3.4 on TCP port 443, and for every connection, spawn the βhttpdβ program reading queries on stdin and replying on stdout, as user βwwwβ, with a TLS layer protecting the connection, the TLS engine running as user βnobodyβ (β65534:65534β). The server is authenticated by the certificate in /etc/ssl/public/mycert.pem that it sends to the client, and the private key in /etc/ssl/private/mykey.der that it keeps to itself. ate and left no crumbs π₯
π SEE ALSO π
s6-tls(7),s6-applyuidgid(8),s6-tcpserver(8),s6-tcpserver-access(8),s6-tcpserverd(8),s6-tlsc(8),s6-tlsc-io(8),s6-tlsclient(8),s6-tlsd(8),s6-tlsd-io(8),s6-ucspitlsc(8),s6-ucspitlsd(8)- [1] https://cr.yp.to/proto/ucspi.txt
- This man page is ported from the authoritative documentation at: https://skarnet.org/software/s6-networking/s6-tlsserver.html
π AUTHORS π
- Laurent Bercot
- Alexis <flexibeast@gmail.com> (man page port)
mwah π this little rewrite is serving Debian's S6-TLSSERVER(8) manual, dated November 20, 2023 β bye bestie, go secure those sockets π«Άβ¨
π¦ 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