File: //usr/local/rvm/rubies/default/share/man/cat1/sslhandle.0
sslhandle(1) General Commands Manual sslhandle(1)
[1mNAME[0m
sslhandle - preforking TLS server
[1mSYNOPSIS[0m
[1msslhandle [22m[ [4mopts[24m ] [4mhost[24m [4mport[24m [4mprog[0m
[1mDESCRIPTION[0m
[4mopts[24m is a series of getopt-style options, [4mhost[24m is a host name or IP
address, [4mport[24m is a TCP port, and [4mprog[24m is one or more arguments specify‐
ing a program to run for each accepted connection. The [4mserver[24m subrou‐
tine is called within a loop, with one iteration per request listening
to [4m-c[24m [4mn[24m incoming connections simultanously. It must release any
resources allocated to handle a particular request before returning to
its caller.
The server's address is given by [4mhost[24m and [4mport[24m.
[1mBINDINGS[0m
[1msslhandle [22mwill be attached to the primary IP address of [4mhost[24m while the
host name is fed through qualification using [4mdns_ip6_qualify[24m. If [4mhost[0m
is given as dotted decimal IPv4 or compactified IPv6 address, [1msslhandle[0m
will bind uniquely to those. In order to bind [1msslhandle [22mto a LLU IPv6
address (ie. fe80::a:b:c) additionally the interface name [1m-I[4m[22mifname[24m has
to be provided.
[4mNote[24m: The kernel might use temporary changing SLAAC addresses.
[1msslhandle [22mcan be instructed to be multi-homing capable while binding to
all available IP addresses. Now [4mhost[24m is given as [4m0.0.0.0[24m or [4m::[24m.
Further, [1msslhandle [22mcan be forced to provide dual-stack capabilities,
thus allowing IPv4 and IPv6 clients to attach to the same instance once
[4mhost[24m equals ':0' as pseudo IP address.
[4mport[24m may be a numeric port number or a port name. If [4mport[24m is 0, [1mssl‐[0m
[1mhandle [22mwill choose a free port.
[1mSERVING[0m
[1msslhandle [22mlistens for connections from TCP clients. Typically, for
each connection, it runs [4mprog[24m, with file descriptor 0 reading from, and
file descriptor 1 writing to a child process [4mssl[24m. The [4mssl[24m process
attempts an SSL accept via the network. If it succeeds, it translates
data between [4mprog[24m and the network, performing any necessary SSL encod‐
ing and decoding. Before running [4mprog[24m, [1msslhandle [22mreads and sets cer‐
tain environment variables.
[1msslhandle [22mexists, if the parent process receives a SIGTERM.
[1mOPTIONS[0m
[1mGeneral Options:[0m
[1m-q [22mQuiet. Do not print error messages.
[1m-Q [22m(Default.) Print error messages.
[1m-v [22mVerbose. Print error messages and status messages.
[1m-V [22mPrint additional verbose SSL connection informations (protocol
and cipher).
[1mConnection options:[0m
[1m-1 [22mAfter preparing to receive connections, print the local port
number to standard output.
[1m-4 [22mUse IPv4 sockets for connections.
[1m-6 [22mUse IPv6 connections. This will set [4mPROTO[24m to [1mTCP6 [22mand put IPv6
addresses in [4mTCP6LOCALIP[24m and [4mTCP6REMOTEIP[24m.
[1m-c [4m[22mn[24m Do not handle more than [4mn[24m simultaneous connections. If there
are [4mn[24m simultaneous connections copies of [4mprog[24m running, defer
acceptance of a new connection until one copy finishes. [4mn[24m must
be a positive integer. The default value is 40.
[1m-x [4m[22mcdb[24m Follow the rules compiled into [4mcdb[24m by [1mtcprules[22m. These rules may
specify setting environment variables or rejecting connections
from bad sources. You can rerun [1mtcprules [22mto change the rules
while [1msslhandle [22mis running.
[1m-X [22mWith [1m-x [4m[22mcdb,[24m allow connections even if [1m-I cdb [22mdoes not exist.
Normally [1msslhandle [22mwill drop the connection if [4mcdb[24m does not
exist.
[1m-B [4m[22mbanner[0m
Write [4mbanner[24m to the network immediately after each SSL connec‐
tion is made. The [4mbanner[24m is subject to SSL encryption.
[1m-f [4m[22mlockfile[0m
Additional filename given for locking. If [4mlockfile[24m is provided
and not exclusive readable [1msslhandle [22mwill not start. Utilize
this option if your accept system call suffers from the thunder‐
ing herd problem.
[1m-g [4m[22mgid[24m Switch group ID to [4mgid[24m after preparing to receive connections.
[4mgid[24m must be a positive integer.
[1m-u [4m[22muid[24m Switch user ID to [4muid[24m after preparing to receive connections.
[4muid[24m must be a positive integer.
[1m-U [22mSame as [1m-g [22m$GID [1m-u [22m$UID. Typically, $GID and $UID are set by
[1menvuidgid[22m.
[1m-I [4m[22mifname[0m
Bind to the network interface [4mifname[24m ("eth0" on Linux, for exam‐
ple). This is only defined and needed for IPv6 link-local
addresses.
[1m-b [4m[22mn[24m Allow a backlog of approximately [4mn[24m pending connections.
[1m-o [22mLeave IP options alone. If the client is sending packets along
an IP source route, send packets back along the same route.
[1m-O [22m(Default.) Kill IP options. A client can still use source rout‐
ing to connect and to send data, but packets will be sent back
along the default route.
[1m-d [22mDelay sending data for a fraction of a second whenever the
remote host is responding slowly. This is currently the default,
but it may not be in the future; if you want it, set it explic‐
itly.
[1m-D [22mNever delay sending data; enable TCP_NODELAY.
[1m-t [4m[22mn[24m Give up on the $SSLREMOTEINFO connection attempt after [4mn[24m sec‐
onds. The default value is: 26.
[1m-T [4m[22mn[24m Give up on the SSL connection attempt after [4mn[24m seconds. The
default value is: 26.
[1m-w [4m[22mn[24m Give up on a connection or program after waiting [4mn[24m seconds for
read or write. The default value is: 3600.
[1mSSL and TLS connection options:[0m
[1m-s [22mStore client and server certificate information in the environ‐
ment, a la [4mmod_ssl[24m.
[1m-S [22m(Default.) Do not store client and server certificate informa‐
tion in the environment.
[1mX509 certificate and encryption options:[0m
[1m-3 [22mRead a null-terminated [4mkey[24m [4mpassword[24m from file descriptor [4m3[24m.
[1m-m [22m(Mail.) Require valid client certificates, but don't check for
matching FQDN.
[1m-z [22m(Host.) Require valid client certificates and match FQDN (if
given) against SAN/DN.
[1m-Z [22m(Default.) Do not require client certificates.
[1mData-gathering options:[0m
[1m-h [22m(Default.) Look up the remote host name in DNS to set the envi‐
ronment variable $SSLREMOTEHOST. In this case, additionally the
CN/SAN in the X509 certificate can be checked, provided, the
option [1m-z [22mis set.
[1m-H [22mDo not look up the remote host name in DNS; remove the environ‐
ment variable $SSLREMOTEHOST. To avoid loops, you must use this
option for servers on TCP port 53.
[1m-p [22mParanoid. After looking up the remote host name in DNS, look up
the IP addresses in DNS for that host name, and remove the envi‐
ronment variable $SSLREMOTEHOST if none of the addresses match
the client's IP address.
[1m-P [22m(Default.) Not paranoid.
[1m-l [4m[22mlocalname[0m
Do not look up the local host name in DNS; use [4mlocalname[24m for the
environment variable $SSLLOCALHOST. A common choice for [4mlocal‐[0m
[4mname[24m is 0. To avoid loops, you must use this option for servers
on TCP port 53.
[1m-r [22mAttempt to obtain $SSLREMOTEINFO from the remote host.
[1m-R [22m(Default.) Do not attempt to obtain $SSLREMOTEINFO from the
remote host. To avoid loops, you must use this option for
servers on TCP ports 53 and 113.
[1m-e [22mSet protocol environment a la [1mtcpserver . [22mSet $TCPLOCALIP,
$TCPLOCALPORT, $TCPLOCALHOST, $TCPREMOTEIP, $TCPREMOTEPORT,
$TCPREMOTEHOST, and $TCPREMOTEINFO as well as for IPv6 connec‐
tions additionally $TCP6REMOTEIP, $TCP6RMEOTEHOST, and
$TCP6REMOTEINFO from the current $SSL environment (see below).
[1m-E [22m(Default.) Do not set any [1mtcpserver [22menvironment variables.
[1mDNS RESOLVER SETTINGS[0m
Use [4m$DNSCACHEIP[24m to set the DNS resolver IP dynamically irrespectively
from the settings in [4m/etc/resolv.conf[24m. If the environment variable
[4m$LOCALDOMAIN[24m is populated, this name will be appended to unqualified
host names. Additional rewriting of local to public names is facili‐
tated in case the file [4m/etc/dnswritefile[24m exists and is populated, or
alternatively the environment variable [4m$DNSREWRITEFILE[24m points to a dif‐
fernent file.
[1mSSL ENVIRONMENT VARIABLES READ[0m
These variables define the run-time environment of [1msslhandle [22mand are
used to specify X509 certificates and keyfile per connection.
[1m$SSL_USER=[4m[22mname[0m
The user, reading the certificates and keyfile.
[1m$SSL_GROUP=[4m[22mgroup[0m
The respective user group.
[1m$SSL_UID=[4m[22muid[0m
The numerical UID of the $SSL_USER.
[1m$SSL_CHROOT=[4m[22mpath[0m
Perform reading of certificates and keyfile in a $SSL_CHROOT
jail.
[1m$CAFILE=[4m[22mpath[0m
If set, overrides the compiled-in CA file name. The CA file
contains the list of CAs used to verify the client certificate.
Certificates in $CAFILE are processed when the server starts.
[1m$CADIR=[4m[22mpath[0m
If set, overrides the compiled-in CA directory name. The CA
directory contains certificates files used to verify the client
certificate. This list augments the list from $CAFILE. Cer‐
tificates in $CADIR are processed during certificate verifica‐
tion.
[1m$CERTFILE=[4m[22mpath[0m
If set, overrides the compiled-in certificate file name. The
server presents this certificate to clients.
[1m$CERTCHAINFILE=[4m[22mpath[0m
If set, overrides the compiled-in certificate chainfile name.
The server presents this list of certificats to clients. [4mNote:[0m
Providing $CERTCHAINFILE has precedence over $CERTFILE. Cer‐
tificates in this file needs to be 'ordered' starting from the
uppermost root certificates and placing your host's certificate
at the end.
[1m$CIPHERS=[4m[22mstring[0m
If set, override the compiled-in SSL cipher list defining the
security level for the connection. A typical choice would be
'TLSv1+HIGH:!SSLv2:!MD5'.
[1m$DHFILE=[4m[22mpath[0m
If set, overrides the compiled-in DH parameter file name.
[1m$KEYFILE=[4m[22mpath[0m
If set, overrides the compiled-in key file name. The key is
used when loading the server certificate. Setting $KEYFILE to
the empty instructs the server not to use a [4mkeyfile[24m when loading
it's certificate.
[1m$VERIFYDEPTH=[4m[22mn[0m
If set, overrides the compiled-in verification depth. Default:
1.
[1m$CCAFILE=[4m[22mpath[0m
If set, overrides the compiled-in client CA file name for client
certificate request. The client CA file contains the list of
CAs sent to the client when requesting a client certificate.
[4mNote:[24m Setting of $CCAFILE is required while using the option [4m-z[0m
or [4m-m.[24m However, declaring [1m$CCAFILE="-" [22mdisables (on a per-con‐
nection base) the client certificate request.
[1m$CCAVERIFY[0m
If set, [1msslhandle [22mrequests a valid client certificate on a per-
connection base, unlike the general option [4m-z[24m.
[1mSSL ENVIRONMENT VARAIBLES SET[0m
In case [1msslhandle [22mis called with the option [1m-e[22m, the following [4mmod_ssl[0m
environment variables are provided:
[1mSSL_PROTOCOL[0m
The TLS protocol version (SSLv3, TLSv1, ...).
[1mSSL_SESSION_ID[0m
The hex-encoded SSL session id.
[1mSSL_CIPHER[0m
The cipher specification name.
[1mSSL_CIPHER_USEKEYSIZE[0m
Number of cipher bits (actually used).
[1mSSL_CIPHER_ALGKEYSIZE[0m
Number of cipher bits (possible).
[1mSSL_VERSION_INTERFACE[0m
The mod_ssl program version.
[1mSSL_VERSION_LIBRARY[0m
The OpenSSL program version.
[1mSSL_CLIENT_M_VERSION[0m
The version of the client certificate.
[1mSSL_CLIENT_M_SERIAL[0m
The serial of the client certificate.
[1mSSL_CLIENT_S_DN[0m
Subject DN in client's certificate.
[1mSSL_CLIENT_S_DN_x509[0m
Component of client's Subject DN.
[1mSSL_CLIENT_I_DN[0m
Issuer DN of client's certificate.
[1mSSL_CLIENT_I_DN_x509[0m
Component of client's Issuer DN.
[1mSSL_CLIENT_V_START[0m
Validity of client's certificate (start time).
[1mSSL_CLIENT_V_END[0m
Validity of client's certificate (end time).
[1mSSL_CLIENT_A_SIG[0m
Algorithm used for the signature of client's certificate.
[1mSSL_CLIENT_A_KEY[0m
Algorithm used for the public key of client's certificate.
[1mSSL_CLIENT_CERT[0m
PEM-encoded client certificate.
[1mSSL_CLIENT_CERT_CHAIN [4m[22mn[0m
PEM-encoded certificates in client certificate chain.
[1mSSL_CLIENT_VERIFY[0m
NONE, SUCCESS, GENEROUS or FAILED:reason.
[1mSSL_SERVER_M_SERIAL[0m
The serial of the server certificate.
[1mSSL_SERVER_S_DN[0m
Subject DN in server's certificate.
[1mSSL_SERVER_S_DN_x509[0m
Component of server's Subject DN.
[1mSSL_SERVER_I_DN[0m
Issuer DN of server's certificate.
[1mSSL_SERVER_I_DN_x509[0m
Component of server's Issuer DN.
[1mSSL_SERVER_V_START[0m
Validity of server's certificate (start time).
[1mSSL_SERVER_V_END[0m
Validity of server's certificate (end time).
[1mSSL_SERVER_A_SIG[0m
Algorithm used for the signature of server's certificate.
[1mSSL_SERVER_A_KEY[0m
Algorithm used for the public key of server's certificate.
[1mSSL_SERVER_CERT[0m
PEM-encoded server certificate.
For $SSL_CLIENT_x_DN_x509 and $SSL_SERVER_x_DN_x509, x509 denotes a
component of the DN: C, ST, L, O, OU, CN, T, I, G, S, D, UID, Email.
Other SSL environment variables set:
[1mPROTO, SSLLOCALHOST, SSLLOCALIP, SSLLOCALPORT, SSLREMOTEHOST, SSLRE‐[0m
[1mMOTEINFO, SSLREMOTEIP, SSLREMOTEPORT.[0m
TCP environment variables set:
[1mTCPLOCALHOST, TCPLOCALIP, TCPLOCALPORT, TCPREMOTEHOST, TCPREMOTEINFO,[0m
[1mTCPREMOTEIP, TCPREMOTEPORT.[0m
TCP6 environment variables set:
[1mTCP6INTERFACE, TCP6LOCALHOST, TCP6LOCALIP, TCP6LOCALPORT, TCP6REMOTE‐[0m
[1mHOST, TCP6REMOTEIP, TCP6REMOTEPORT.[0m
[1mLOGGING AND ERROR MESSAGES[0m
[1msslhandle [22mprints information about individual connections in case [4m-v[24m or
[4m-V[24m is specified as argument. TLS error messages are provided if possi‐
ble:
[1munable to speak TLS for pid: ... DH lib[0m
TLS handshake failure.
[1munable to accept TLS for pid: ...[0m
The remote socket was prematurely closed.
[1mSEE ALSO[0m
sslserver(1), sslclient(1), sslconnect(1), sslcat(1), https@(1), ucspi-
tls(2), tcprules(1), tcprulescheck(1), tcpserver(1), tcp-environ(5)
[1mREFERENCE[0m
http://httpd.apache.org/docs/2.4/mod/mod_ssl.html http://www.super‐
script.com/ucspi-ssl/prefork.html
sslhandle(1)