1626 lines
51 KiB
XML
1626 lines
51 KiB
XML
<?xml version="1.0" ?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<title>stunnel TLS Proxy</title>
|
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
|
<link rev="made" href="mailto:root@localhost" />
|
|
</head>
|
|
|
|
<body id="_podtop_">
|
|
<table border="0" width="100%" cellspacing="0" cellpadding="3">
|
|
<tr><td class="_podblock_" style="background-color: #cccccc; color: #000" valign="middle">
|
|
<big><strong><span class="_podblock_"> stunnel TLS Proxy</span></strong></big>
|
|
</td></tr>
|
|
</table>
|
|
|
|
|
|
|
|
<ul id="index">
|
|
<li><a href="#NAME">NAME</a></li>
|
|
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
|
|
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
|
|
<li><a href="#OPTIONS">OPTIONS</a></li>
|
|
<li><a href="#CONFIGURATION-FILE">CONFIGURATION FILE</a>
|
|
<ul>
|
|
<li><a href="#GLOBAL-OPTIONS">GLOBAL OPTIONS</a></li>
|
|
<li><a href="#SERVICE-LEVEL-OPTIONS">SERVICE-LEVEL OPTIONS</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#RETURN-VALUE">RETURN VALUE</a></li>
|
|
<li><a href="#SIGNALS">SIGNALS</a></li>
|
|
<li><a href="#EXAMPLES">EXAMPLES</a></li>
|
|
<li><a href="#NOTES">NOTES</a>
|
|
<ul>
|
|
<li><a href="#RESTRICTIONS">RESTRICTIONS</a></li>
|
|
<li><a href="#INETD-MODE">INETD MODE</a></li>
|
|
<li><a href="#CERTIFICATES">CERTIFICATES</a></li>
|
|
<li><a href="#RANDOMNESS">RANDOMNESS</a></li>
|
|
<li><a href="#DH-PARAMETERS">DH PARAMETERS</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#FILES">FILES</a></li>
|
|
<li><a href="#BUGS">BUGS</a></li>
|
|
<li><a href="#SEE-ALSO">SEE ALSO</a></li>
|
|
<li><a href="#AUTHOR">AUTHOR</a></li>
|
|
</ul>
|
|
|
|
<a href="#_podtop_"><h1 id="NAME">NAME</h1></a>
|
|
|
|
<p>stunnel - TLS offloading and load-balancing proxy</p>
|
|
|
|
<a href="#_podtop_"><h1 id="SYNOPSIS">SYNOPSIS</h1></a>
|
|
|
|
<dl>
|
|
|
|
<dt id="Unix"><b>Unix:</b></dt>
|
|
<dd>
|
|
|
|
<p><b>stunnel</b> [<span style="white-space: nowrap;">FILE</span>] | <span style="white-space: nowrap;">-fd N</span> | <span style="white-space: nowrap;">-help</span> | <span style="white-space: nowrap;">-version</span> | <span style="white-space: nowrap;">-sockets</span> | <span style="white-space: nowrap;">-options</span></p>
|
|
|
|
</dd>
|
|
<dt id="WIN32"><b>WIN32:</b></dt>
|
|
<dd>
|
|
|
|
<p><b>stunnel</b> [ [ <span style="white-space: nowrap;">-install</span> | <span style="white-space: nowrap;">-uninstall</span> | <span style="white-space: nowrap;">-start</span> | <span style="white-space: nowrap;">-stop</span> | <span style="white-space: nowrap;">-reload</span> | <span style="white-space: nowrap;">-reopen</span> | <span style="white-space: nowrap;">-exit</span> ] [<span style="white-space: nowrap;">-quiet</span>] [<span style="white-space: nowrap;">FILE</span>] ] | <span style="white-space: nowrap;">-help</span> | <span style="white-space: nowrap;">-version</span> | <span style="white-space: nowrap;">-sockets</span> | <span style="white-space: nowrap;">-options</span></p>
|
|
|
|
</dd>
|
|
</dl>
|
|
|
|
<a href="#_podtop_"><h1 id="DESCRIPTION">DESCRIPTION</h1></a>
|
|
|
|
<p>The <b>stunnel</b> program is designed to work as <i>TLS</i> encryption wrapper between remote clients and local (<i>inetd</i>-startable) or remote servers. The concept is that having non-TLS aware daemons running on your system you can easily set them up to communicate with clients over secure <i>TLS</i> channels.</p>
|
|
|
|
<p><b>stunnel</b> can be used to add <i>TLS</i> functionality to commonly used <i>Inetd</i> daemons like POP-2, POP-3, and IMAP servers, to standalone daemons like NNTP, SMTP and HTTP, and in tunneling PPP over network sockets without changes to the source code.</p>
|
|
|
|
<p>This product includes cryptographic software written by Eric Young (eay@cryptsoft.com)</p>
|
|
|
|
<a href="#_podtop_"><h1 id="OPTIONS">OPTIONS</h1></a>
|
|
|
|
<dl>
|
|
|
|
<dt id="FILE"><b>FILE</b></dt>
|
|
<dd>
|
|
|
|
<p>Use specified configuration file</p>
|
|
|
|
</dd>
|
|
<dt id="fd-N-Unix-only"><b>-fd N</b> (Unix only)</dt>
|
|
<dd>
|
|
|
|
<p>Read the config file from specified file descriptor</p>
|
|
|
|
</dd>
|
|
<dt id="help"><b>-help</b></dt>
|
|
<dd>
|
|
|
|
<p>Print <b>stunnel</b> help menu</p>
|
|
|
|
</dd>
|
|
<dt id="version"><b>-version</b></dt>
|
|
<dd>
|
|
|
|
<p>Print <b>stunnel</b> version and compile time defaults</p>
|
|
|
|
</dd>
|
|
<dt id="sockets"><b>-sockets</b></dt>
|
|
<dd>
|
|
|
|
<p>Print default socket options</p>
|
|
|
|
</dd>
|
|
<dt id="options"><b>-options</b></dt>
|
|
<dd>
|
|
|
|
<p>Print supported TLS options</p>
|
|
|
|
</dd>
|
|
<dt id="install-Windows-NT-and-later-only"><b>-install</b> (Windows NT and later only)</dt>
|
|
<dd>
|
|
|
|
<p>Install NT Service</p>
|
|
|
|
</dd>
|
|
<dt id="uninstall-Windows-NT-and-later-only"><b>-uninstall</b> (Windows NT and later only)</dt>
|
|
<dd>
|
|
|
|
<p>Uninstall NT Service</p>
|
|
|
|
</dd>
|
|
<dt id="start-Windows-NT-and-later-only"><b>-start</b> (Windows NT and later only)</dt>
|
|
<dd>
|
|
|
|
<p>Start NT Service</p>
|
|
|
|
</dd>
|
|
<dt id="stop-Windows-NT-and-later-only"><b>-stop</b> (Windows NT and later only)</dt>
|
|
<dd>
|
|
|
|
<p>Stop NT Service</p>
|
|
|
|
</dd>
|
|
<dt id="reload-Windows-NT-and-later-only"><b>-reload</b> (Windows NT and later only)</dt>
|
|
<dd>
|
|
|
|
<p>Reload the configuration file of the running NT Service</p>
|
|
|
|
</dd>
|
|
<dt id="reopen-Windows-NT-and-later-only"><b>-reopen</b> (Windows NT and later only)</dt>
|
|
<dd>
|
|
|
|
<p>Reopen the log file of the running NT Service</p>
|
|
|
|
</dd>
|
|
<dt id="exit-Win32-only"><b>-exit</b> (Win32 only)</dt>
|
|
<dd>
|
|
|
|
<p>Exit an already started stunnel</p>
|
|
|
|
</dd>
|
|
<dt id="quiet-Win32-only"><b>-quiet</b> (Win32 only)</dt>
|
|
<dd>
|
|
|
|
<p>Don't display any message boxes</p>
|
|
|
|
</dd>
|
|
</dl>
|
|
|
|
<a href="#_podtop_"><h1 id="CONFIGURATION-FILE">CONFIGURATION FILE</h1></a>
|
|
|
|
<p>Each line of the configuration file can be either:</p>
|
|
|
|
<ul>
|
|
|
|
<li><p>An empty line (ignored).</p>
|
|
|
|
</li>
|
|
<li><p>A comment starting with ';' (ignored).</p>
|
|
|
|
</li>
|
|
<li><p>An 'option_name = option_value' pair.</p>
|
|
|
|
</li>
|
|
<li><p>'[service_name]' indicating a start of a service definition.</p>
|
|
|
|
</li>
|
|
</ul>
|
|
|
|
<p>An address parameter of an option may be either:</p>
|
|
|
|
<ul>
|
|
|
|
<li><p>A port number.</p>
|
|
|
|
</li>
|
|
<li><p>A colon-separated pair of IP address (either IPv4, IPv6, or domain name) and port number.</p>
|
|
|
|
</li>
|
|
<li><p>A Unix socket path (Unix only).</p>
|
|
|
|
</li>
|
|
</ul>
|
|
|
|
<h2 id="GLOBAL-OPTIONS">GLOBAL OPTIONS</h2>
|
|
|
|
<dl>
|
|
|
|
<dt id="chroot-DIRECTORY-Unix-only"><b>chroot</b> = DIRECTORY (Unix only)</dt>
|
|
<dd>
|
|
|
|
<p>directory to chroot <b>stunnel</b> process</p>
|
|
|
|
<p><b>chroot</b> keeps <b>stunnel</b> in a chrooted jail. <i>CApath</i>, <i>CRLpath</i>, <i>pid</i> and <i>exec</i> are located inside the jail and the patches have to be relative to the directory specified with <b>chroot</b>.</p>
|
|
|
|
<p>Several functions of the operating system also need their files to be located within the chroot jail, e.g.:</p>
|
|
|
|
<ul>
|
|
|
|
<li><p>Delayed resolver typically needs /etc/nsswitch.conf and /etc/resolv.conf.</p>
|
|
|
|
</li>
|
|
<li><p>Local time in log files needs /etc/timezone.</p>
|
|
|
|
</li>
|
|
<li><p>Some other functions may need devices, e.g. /dev/zero or /dev/null.</p>
|
|
|
|
</li>
|
|
</ul>
|
|
|
|
</dd>
|
|
<dt id="compression-deflate-zlib"><b>compression</b> = deflate | zlib</dt>
|
|
<dd>
|
|
|
|
<p>select data compression algorithm</p>
|
|
|
|
<p>default: no compression</p>
|
|
|
|
<p>Deflate is the standard compression method as described in RFC 1951.</p>
|
|
|
|
</dd>
|
|
<dt id="debug-FACILITY.-LEVEL"><b>debug</b> = [FACILITY.]LEVEL</dt>
|
|
<dd>
|
|
|
|
<p>debugging level</p>
|
|
|
|
<p>Level is one of the syslog level names or numbers emerg (0), alert (1), crit (2), err (3), warning (4), notice (5), info (6), or debug (7). All logs for the specified level and all levels numerically less than it will be shown. Use <i>debug = debug</i> or <i>debug = 7</i> for greatest debugging output. The default is notice (5).</p>
|
|
|
|
<p>The syslog facility 'daemon' will be used unless a facility name is supplied. (Facilities are not supported on Win32.)</p>
|
|
|
|
<p>Case is ignored for both facilities and levels.</p>
|
|
|
|
</dd>
|
|
<dt id="EGD-EGD_PATH-Unix-only"><b>EGD</b> = EGD_PATH (Unix only)</dt>
|
|
<dd>
|
|
|
|
<p>path to Entropy Gathering Daemon socket</p>
|
|
|
|
<p>Entropy Gathering Daemon socket to use to feed the <b>OpenSSL</b> random number generator.</p>
|
|
|
|
</dd>
|
|
<dt id="engine-auto-ENGINE_ID"><b>engine</b> = auto | ENGINE_ID</dt>
|
|
<dd>
|
|
|
|
<p>select hardware or software cryptographic engine</p>
|
|
|
|
<p>default: software-only cryptography</p>
|
|
|
|
<p>See Examples section for an engine configuration to use the certificate and the corresponding private key from a cryptographic device.</p>
|
|
|
|
</dd>
|
|
<dt id="engineCtrl-COMMAND-:PARAMETER"><b>engineCtrl</b> = COMMAND[:PARAMETER]</dt>
|
|
<dd>
|
|
|
|
<p>control hardware engine</p>
|
|
|
|
</dd>
|
|
<dt id="engineDefault-TASK_LIST"><b>engineDefault</b> = TASK_LIST</dt>
|
|
<dd>
|
|
|
|
<p>set OpenSSL tasks delegated to the current engine</p>
|
|
|
|
<p>The parameter specifies a comma-separated list of task to be delegated to the current engine.</p>
|
|
|
|
<p>The following tasks may be available, if supported by the engine: ALL, RSA, DSA, ECDH, ECDSA, DH, RAND, CIPHERS, DIGESTS, PKEY, PKEY_CRYPTO, PKEY_ASN1.</p>
|
|
|
|
</dd>
|
|
<dt id="fips-yes-no"><b>fips</b> = yes | no</dt>
|
|
<dd>
|
|
|
|
<p>enable or disable FIPS 140-2 mode.</p>
|
|
|
|
<p>This option allows you to disable entering FIPS mode if <b>stunnel</b> was compiled with FIPS 140-2 support.</p>
|
|
|
|
<p>default: no (since version 5.00)</p>
|
|
|
|
</dd>
|
|
<dt id="foreground-yes-quiet-no-Unix-only"><b>foreground</b> = yes | quiet | no (Unix only)</dt>
|
|
<dd>
|
|
|
|
<p>foreground mode</p>
|
|
|
|
<p>Stay in foreground (don't fork).</p>
|
|
|
|
<p>With the <i>yes</i> parameter it also logs to stderr in addition to the destinations specified with <i>syslog</i> and <i>output</i>.</p>
|
|
|
|
<p>default: background in daemon mode</p>
|
|
|
|
</dd>
|
|
<dt id="iconActive-ICON_FILE-GUI-only"><b>iconActive</b> = ICON_FILE (GUI only)</dt>
|
|
<dd>
|
|
|
|
<p>GUI icon to be displayed when there are established connections</p>
|
|
|
|
<p>On Windows platform the parameter should be an .ico file containing a 16x16 pixel image.</p>
|
|
|
|
</dd>
|
|
<dt id="iconError-ICON_FILE-GUI-only"><b>iconError</b> = ICON_FILE (GUI only)</dt>
|
|
<dd>
|
|
|
|
<p>GUI icon to be displayed when no valid configuration is loaded</p>
|
|
|
|
<p>On Windows platform the parameter should be an .ico file containing a 16x16 pixel image.</p>
|
|
|
|
</dd>
|
|
<dt id="iconIdle-ICON_FILE-GUI-only"><b>iconIdle</b> = ICON_FILE (GUI only)</dt>
|
|
<dd>
|
|
|
|
<p>GUI icon to be displayed when there are no established connections</p>
|
|
|
|
<p>On Windows platform the parameter should be an .ico file containing a 16x16 pixel image.</p>
|
|
|
|
</dd>
|
|
<dt id="log-append-overwrite"><b>log</b> = append | overwrite</dt>
|
|
<dd>
|
|
|
|
<p>log file handling</p>
|
|
|
|
<p>This option allows you to choose whether the log file (specified with the <i>output</i> option) is appended or overwritten when opened or re-opened.</p>
|
|
|
|
<p>default: append</p>
|
|
|
|
</dd>
|
|
<dt id="output-FILE"><b>output</b> = FILE</dt>
|
|
<dd>
|
|
|
|
<p>append log messages to a file</p>
|
|
|
|
<p>/dev/stdout device can be used to send log messages to the standard output (for example to log them with daemontools splogger).</p>
|
|
|
|
</dd>
|
|
<dt id="pid-FILE-Unix-only"><b>pid</b> = FILE (Unix only)</dt>
|
|
<dd>
|
|
|
|
<p>pid file location</p>
|
|
|
|
<p>If the argument is empty, then no pid file will be created.</p>
|
|
|
|
<p><i>pid</i> path is relative to the <i>chroot</i> directory if specified.</p>
|
|
|
|
</dd>
|
|
<dt id="RNDbytes-BYTES"><b>RNDbytes</b> = BYTES</dt>
|
|
<dd>
|
|
|
|
<p>bytes to read from random seed files</p>
|
|
|
|
</dd>
|
|
<dt id="RNDfile-FILE"><b>RNDfile</b> = FILE</dt>
|
|
<dd>
|
|
|
|
<p>path to file with random seed data</p>
|
|
|
|
<p>The OpenSSL library will use data from this file first to seed the random number generator.</p>
|
|
|
|
</dd>
|
|
<dt id="RNDoverwrite-yes-no"><b>RNDoverwrite</b> = yes | no</dt>
|
|
<dd>
|
|
|
|
<p>overwrite the random seed files with new random data</p>
|
|
|
|
<p>default: yes</p>
|
|
|
|
</dd>
|
|
<dt id="service-SERVICE-Unix-only"><b>service</b> = SERVICE (Unix only)</dt>
|
|
<dd>
|
|
|
|
<p>stunnel service name</p>
|
|
|
|
<p>The specified service name is used for syslog and as the <i>inetd</i> mode service name for TCP Wrappers. While this option can technically be specified in the service sections, it is only useful in global options.</p>
|
|
|
|
<p>default: stunnel</p>
|
|
|
|
</dd>
|
|
<dt id="socket-a-l-r:OPTION-VALUE-:VALUE"><b>socket</b> = a|l|r:OPTION=VALUE[:VALUE]</dt>
|
|
<dd>
|
|
|
|
<p>Set an option on the accept/local/remote socket</p>
|
|
|
|
<p>The values for the linger option are l_onof:l_linger. The values for the time are tv_sec:tv_usec.</p>
|
|
|
|
<p>Examples:</p>
|
|
|
|
<pre><code> socket = l:SO_LINGER=1:60
|
|
set one minute timeout for closing local socket
|
|
socket = r:SO_OOBINLINE=yes
|
|
place out-of-band data directly into the
|
|
receive data stream for remote sockets
|
|
socket = a:SO_REUSEADDR=no
|
|
disable address reuse (enabled by default)
|
|
socket = a:SO_BINDTODEVICE=lo
|
|
only accept connections on loopback interface</code></pre>
|
|
|
|
</dd>
|
|
<dt id="syslog-yes-no-Unix-only"><b>syslog</b> = yes | no (Unix only)</dt>
|
|
<dd>
|
|
|
|
<p>enable logging via syslog</p>
|
|
|
|
<p>default: yes</p>
|
|
|
|
</dd>
|
|
<dt id="taskbar-yes-no-WIN32-only"><b>taskbar</b> = yes | no (WIN32 only)</dt>
|
|
<dd>
|
|
|
|
<p>enable the taskbar icon</p>
|
|
|
|
<p>default: yes</p>
|
|
|
|
</dd>
|
|
</dl>
|
|
|
|
<h2 id="SERVICE-LEVEL-OPTIONS">SERVICE-LEVEL OPTIONS</h2>
|
|
|
|
<p>Each configuration section begins with a service name in square brackets. The service name is used for libwrap (TCP Wrappers) access control and lets you distinguish <b>stunnel</b> services in your log files.</p>
|
|
|
|
<p>Note that if you wish to run <b>stunnel</b> in <i>inetd</i> mode (where it is provided a network socket by a server such as <i>inetd</i>, <i>xinetd</i>, or <i>tcpserver</i>) then you should read the section entitled <i>INETD MODE</i> below.</p>
|
|
|
|
<dl>
|
|
|
|
<dt id="accept-HOST:-PORT"><b>accept</b> = [HOST:]PORT</dt>
|
|
<dd>
|
|
|
|
<p>accept connections on specified address</p>
|
|
|
|
<p>If no host specified, defaults to all IPv4 addresses for the local host.</p>
|
|
|
|
<p>To listen on all IPv6 addresses use:</p>
|
|
|
|
<pre><code> accept = :::PORT</code></pre>
|
|
|
|
</dd>
|
|
<dt id="CApath-DIRECTORY"><b>CApath</b> = DIRECTORY</dt>
|
|
<dd>
|
|
|
|
<p>Certificate Authority directory</p>
|
|
|
|
<p>This is the directory in which <b>stunnel</b> will look for certificates when using the <i>verifyChain</i> or <i>verifyPeer</i> options. Note that the certificates in this directory should be named XXXXXXXX.0 where XXXXXXXX is the hash value of the DER encoded subject of the cert.</p>
|
|
|
|
<p>The hash algorithm has been changed in <b>OpenSSL 1.0.0</b>. It is required to c_rehash the directory on upgrade from <b>OpenSSL 0.x.x</b> to <b>OpenSSL 1.x.x</b>.</p>
|
|
|
|
<p><i>CApath</i> path is relative to the <i>chroot</i> directory if specified.</p>
|
|
|
|
</dd>
|
|
<dt id="CAfile-CA_FILE"><b>CAfile</b> = CA_FILE</dt>
|
|
<dd>
|
|
|
|
<p>Certificate Authority file</p>
|
|
|
|
<p>This file contains multiple CA certificates, to be used with the <i>verifyChain</i> and <i>verifyPeer</i> options.</p>
|
|
|
|
</dd>
|
|
<dt id="cert-CERT_FILE"><b>cert</b> = CERT_FILE</dt>
|
|
<dd>
|
|
|
|
<p>certificate chain file name</p>
|
|
|
|
<p>The parameter specifies the file containing certificates used by <b>stunnel</b> to authenticate itself against the remote client or server. The file should contain the whole certificate chain starting from the actual server/client certificate, and ending with the self-signed root CA certificate. The file must be either in PEM or P12 format.</p>
|
|
|
|
<p>A certificate chain is required in server mode, and optional in client mode.</p>
|
|
|
|
<p>This parameter is also used as the certificate identifier when a hardware engine is enabled.</p>
|
|
|
|
</dd>
|
|
<dt id="checkEmail-EMAIL"><b>checkEmail</b> = EMAIL</dt>
|
|
<dd>
|
|
|
|
<p>email address of the peer certificate subject</p>
|
|
|
|
<p>Multiple <i>checkEmail</i> options are allowed in a single service section. Certificates are accepted if no <i>checkEmail</i> option was specified, or the email address of the peer certificate matches any of the email addresses specified with <i>checkEmail</i>.</p>
|
|
|
|
<p>This option requires OpenSSL 1.0.2 or later.</p>
|
|
|
|
</dd>
|
|
<dt id="checkHost-HOST"><b>checkHost</b> = HOST</dt>
|
|
<dd>
|
|
|
|
<p>host of the peer certificate subject</p>
|
|
|
|
<p>Multiple <i>checkHost</i> options are allowed in a single service section. Certificates are accepted if no <i>checkHost</i> option was specified, or the host name of the peer certificate matches any of the hosts specified with <i>checkHost</i>.</p>
|
|
|
|
<p>This option requires OpenSSL 1.0.2 or later.</p>
|
|
|
|
</dd>
|
|
<dt id="checkIP-IP"><b>checkIP</b> = IP</dt>
|
|
<dd>
|
|
|
|
<p>IP address of the peer certificate subject</p>
|
|
|
|
<p>Multiple <i>checkIP</i> options are allowed in a single service section. Certificates are accepted if no <i>checkIP</i> option was specified, or the IP address of the peer certificate matches any of the IP addresses specified with <i>checkIP</i>.</p>
|
|
|
|
<p>This option requires OpenSSL 1.0.2 or later.</p>
|
|
|
|
</dd>
|
|
<dt id="ciphers-CIPHER_LIST"><b>ciphers</b> = CIPHER_LIST</dt>
|
|
<dd>
|
|
|
|
<p>Select permitted TLS ciphers</p>
|
|
|
|
<p>A colon-delimited list of the ciphers to allow in the TLS connection, for example DES-CBC3-SHA:IDEA-CBC-MD5.</p>
|
|
|
|
</dd>
|
|
<dt id="client-yes-no"><b>client</b> = yes | no</dt>
|
|
<dd>
|
|
|
|
<p>client mode (remote service uses TLS)</p>
|
|
|
|
<p>default: no (server mode)</p>
|
|
|
|
</dd>
|
|
<dt id="config-COMMAND-:PARAMETER"><b>config</b> = COMMAND[:PARAMETER]</dt>
|
|
<dd>
|
|
|
|
<p><b>OpenSSL</b> configuration command</p>
|
|
|
|
<p>The <b>OpenSSL</b> configuration command is executed with the specified parameter. This allows any configuration commands to be invoked from the stunnel configuration file. Supported commands are described on the <i>SSL_CONF_cmd(3ssl)</i> manual page.</p>
|
|
|
|
<p>Several <i>config</i> lines can be used to specify multiple configuration commands.</p>
|
|
|
|
<p>This option requires OpenSSL 1.0.2 or later.</p>
|
|
|
|
</dd>
|
|
<dt id="connect-HOST:-PORT"><b>connect</b> = [HOST:]PORT</dt>
|
|
<dd>
|
|
|
|
<p>connect to a remote address</p>
|
|
|
|
<p>If no host is specified, the host defaults to localhost.</p>
|
|
|
|
<p>Multiple <i>connect</i> options are allowed in a single service section.</p>
|
|
|
|
<p>If host resolves to multiple addresses and/or if multiple <i>connect</i> options are specified, then the remote address is chosen using a round-robin algorithm.</p>
|
|
|
|
</dd>
|
|
<dt id="CRLpath-DIRECTORY"><b>CRLpath</b> = DIRECTORY</dt>
|
|
<dd>
|
|
|
|
<p>Certificate Revocation Lists directory</p>
|
|
|
|
<p>This is the directory in which <b>stunnel</b> will look for CRLs when using the <i>verifyChain</i> and <i>verifyPeer</i> options. Note that the CRLs in this directory should be named XXXXXXXX.r0 where XXXXXXXX is the hash value of the CRL.</p>
|
|
|
|
<p>The hash algorithm has been changed in <b>OpenSSL 1.0.0</b>. It is required to c_rehash the directory on upgrade from <b>OpenSSL 0.x.x</b> to <b>OpenSSL 1.x.x</b>.</p>
|
|
|
|
<p><i>CRLpath</i> path is relative to the <i>chroot</i> directory if specified.</p>
|
|
|
|
</dd>
|
|
<dt id="CRLfile-CRL_FILE"><b>CRLfile</b> = CRL_FILE</dt>
|
|
<dd>
|
|
|
|
<p>Certificate Revocation Lists file</p>
|
|
|
|
<p>This file contains multiple CRLs, used with the <i>verifyChain</i> and <i>verifyPeer</i> options.</p>
|
|
|
|
</dd>
|
|
<dt id="curve-NID"><b>curve</b> = NID</dt>
|
|
<dd>
|
|
|
|
<p>specify ECDH curve name</p>
|
|
|
|
<p>To get a list of supported curves use:</p>
|
|
|
|
<pre><code> openssl ecparam -list_curves</code></pre>
|
|
|
|
<p>default: prime256v1</p>
|
|
|
|
</dd>
|
|
<dt id="logId-TYPE"><b>logId</b> = TYPE</dt>
|
|
<dd>
|
|
|
|
<p>connection identifier type</p>
|
|
|
|
<p>This identifier allows you to distinguish log entries generated for each of the connections.</p>
|
|
|
|
<p>Currently supported types:</p>
|
|
|
|
<dl>
|
|
|
|
<dt id="sequential"><i>sequential</i></dt>
|
|
<dd>
|
|
|
|
<p>The numeric sequential identifier is only unique within a single instance of <b>stunnel</b>, but very compact. It is most useful for manual log analysis.</p>
|
|
|
|
</dd>
|
|
<dt id="unique"><i>unique</i></dt>
|
|
<dd>
|
|
|
|
<p>This alphanumeric identifier is globally unique, but longer than the sequential number. It is most useful for automated log analysis.</p>
|
|
|
|
</dd>
|
|
<dt id="thread"><i>thread</i></dt>
|
|
<dd>
|
|
|
|
<p>The operating system thread identifier is neither unique (even within a single instance of <b>stunnel</b>) nor short. It is most useful for debugging software or configuration issues.</p>
|
|
|
|
</dd>
|
|
<dt id="process"><i>process</i></dt>
|
|
<dd>
|
|
|
|
<p>The operating system process identifier (PID) may be useful in the inetd mode.</p>
|
|
|
|
</dd>
|
|
</dl>
|
|
|
|
<p>default: sequential</p>
|
|
|
|
</dd>
|
|
<dt id="debug-LEVEL"><b>debug</b> = LEVEL</dt>
|
|
<dd>
|
|
|
|
<p>debugging level</p>
|
|
|
|
<p>Level is a one of the syslog level names or numbers emerg (0), alert (1), crit (2), err (3), warning (4), notice (5), info (6), or debug (7). All logs for the specified level and all levels numerically less than it will be shown. Use <i>debug = debug</i> or <i>debug = 7</i> for greatest debugging output. The default is notice (5).</p>
|
|
|
|
</dd>
|
|
<dt id="delay-yes-no"><b>delay</b> = yes | no</dt>
|
|
<dd>
|
|
|
|
<p>delay DNS lookup for the <i>connect</i> option</p>
|
|
|
|
<p>This option is useful for dynamic DNS, or when DNS is not available during <b>stunnel</b> startup (road warrior VPN, dial-up configurations).</p>
|
|
|
|
<p>Delayed resolver mode is automatically engaged when stunnel fails to resolve on startup any of the <i>connect</i> targets for a service.</p>
|
|
|
|
<p>Delayed resolver inflicts <i>failover = prio</i>.</p>
|
|
|
|
<p>default: no</p>
|
|
|
|
</dd>
|
|
<dt id="engineId-ENGINE_ID"><b>engineId</b> = ENGINE_ID</dt>
|
|
<dd>
|
|
|
|
<p>select engine ID for the service</p>
|
|
|
|
</dd>
|
|
<dt id="engineNum-ENGINE_NUMBER"><b>engineNum</b> = ENGINE_NUMBER</dt>
|
|
<dd>
|
|
|
|
<p>select engine number for the service</p>
|
|
|
|
<p>The engines are numbered starting from 1.</p>
|
|
|
|
</dd>
|
|
<dt id="exec-EXECUTABLE_PATH"><b>exec</b> = EXECUTABLE_PATH</dt>
|
|
<dd>
|
|
|
|
<p>execute a local inetd-type program</p>
|
|
|
|
<p><i>exec</i> path is relative to the <i>chroot</i> directory if specified.</p>
|
|
|
|
<p>The following environmental variables are set on Unix platforms: REMOTE_HOST, REMOTE_PORT, SSL_CLIENT_DN, SSL_CLIENT_I_DN.</p>
|
|
|
|
</dd>
|
|
<dt id="execArgs-0-1-2"><b>execArgs</b> = $0 $1 $2 ...</dt>
|
|
<dd>
|
|
|
|
<p>arguments for <i>exec</i> including the program name ($0)</p>
|
|
|
|
<p>Quoting is currently not supported. Arguments are separated with an arbitrary amount of whitespace.</p>
|
|
|
|
</dd>
|
|
<dt id="failover-rr-prio"><b>failover</b> = rr | prio</dt>
|
|
<dd>
|
|
|
|
<p>Failover strategy for multiple "connect" targets.</p>
|
|
|
|
<dl>
|
|
|
|
<dt id="rr"><i>rr</i></dt>
|
|
<dd>
|
|
|
|
<p>round robin - fair load distribution</p>
|
|
|
|
</dd>
|
|
<dt id="prio"><i>prio</i></dt>
|
|
<dd>
|
|
|
|
<p>priority - use the order specified in config file</p>
|
|
|
|
</dd>
|
|
</dl>
|
|
|
|
<p>default: rr</p>
|
|
|
|
</dd>
|
|
<dt id="ident-USERNAME"><b>ident</b> = USERNAME</dt>
|
|
<dd>
|
|
|
|
<p>use IDENT (RFC 1413) username checking</p>
|
|
|
|
</dd>
|
|
<dt id="include-DIRECTORY"><b>include</b> = DIRECTORY</dt>
|
|
<dd>
|
|
|
|
<p>include all configuration file parts located in DIRECTORY</p>
|
|
|
|
<p>The files are included in the ascending alphabetical order of their names.</p>
|
|
|
|
</dd>
|
|
<dt id="key-KEY_FILE"><b>key</b> = KEY_FILE</dt>
|
|
<dd>
|
|
|
|
<p>private key for the certificate specified with <i>cert</i> option</p>
|
|
|
|
<p>A private key is needed to authenticate the certificate owner. Since this file should be kept secret it should only be readable by its owner. On Unix systems you can use the following command:</p>
|
|
|
|
<pre><code> chmod 600 keyfile</code></pre>
|
|
|
|
<p>This parameter is also used as the private key identifier when a hardware engine is enabled.</p>
|
|
|
|
<p>default: the value of the <i>cert</i> option</p>
|
|
|
|
</dd>
|
|
<dt id="libwrap-yes-no"><b>libwrap</b> = yes | no</dt>
|
|
<dd>
|
|
|
|
<p>Enable or disable the use of /etc/hosts.allow and /etc/hosts.deny.</p>
|
|
|
|
<p>default: no (since version 5.00)</p>
|
|
|
|
</dd>
|
|
<dt id="local-HOST"><b>local</b> = HOST</dt>
|
|
<dd>
|
|
|
|
<p>By default, the IP address of the outgoing interface is used as the source for remote connections. Use this option to bind a static local IP address instead.</p>
|
|
|
|
</dd>
|
|
<dt id="OCSP-URL"><b>OCSP</b> = URL</dt>
|
|
<dd>
|
|
|
|
<p>select OCSP responder for certificate verification</p>
|
|
|
|
</dd>
|
|
<dt id="OCSPaia-yes-no"><b>OCSPaia</b> = yes | no</dt>
|
|
<dd>
|
|
|
|
<p>validate certificates with their AIA OCSP responders</p>
|
|
|
|
<p>This option enables <i>stunnel</i> to validate certificates with the list of OCSP responder URLs retrieved from their AIA (Authority Information Access) extension.</p>
|
|
|
|
</dd>
|
|
<dt id="OCSPflag-OCSP_FLAG"><b>OCSPflag</b> = OCSP_FLAG</dt>
|
|
<dd>
|
|
|
|
<p>specify OCSP responder flag</p>
|
|
|
|
<p>Several <i>OCSPflag</i> can be used to specify multiple flags.</p>
|
|
|
|
<p>currently supported flags: NOCERTS, NOINTERN, NOSIGS, NOCHAIN, NOVERIFY, NOEXPLICIT, NOCASIGN, NODELEGATED, NOCHECKS, TRUSTOTHER, RESPID_KEY, NOTIME</p>
|
|
|
|
</dd>
|
|
<dt id="OCSPnonce-yes-no"><b>OCSPnonce</b> = yes | no</dt>
|
|
<dd>
|
|
|
|
<p>send and verify the OCSP nonce extension</p>
|
|
|
|
<p>This option protects the OCSP protocol against replay attacks. Due to its computational overhead, the nonce extension is usually only supported on internal (e.g. corporate) responders, and not on public OCSP responders.</p>
|
|
|
|
</dd>
|
|
<dt id="options-SSL_OPTIONS"><b>options</b> = SSL_OPTIONS</dt>
|
|
<dd>
|
|
|
|
<p><b>OpenSSL</b> library options</p>
|
|
|
|
<p>The parameter is the <b>OpenSSL</b> option name as described in the <i>SSL_CTX_set_options(3ssl)</i> manual, but without <i>SSL_OP_</i> prefix. <i>stunnel -options</i> lists the options found to be allowed in the current combination of <i>stunnel</i> and the <i>OpenSSL</i> library used to build it.</p>
|
|
|
|
<p>Several <i>option</i> lines can be used to specify multiple options. An option name can be prepended with a dash ("-") to disable the option.</p>
|
|
|
|
<p>For example, for compatibility with the erroneous Eudora TLS implementation, the following option can be used:</p>
|
|
|
|
<pre><code> options = DONT_INSERT_EMPTY_FRAGMENTS</code></pre>
|
|
|
|
<p>default:</p>
|
|
|
|
<pre><code> options = NO_SSLv2
|
|
options = NO_SSLv3</code></pre>
|
|
|
|
</dd>
|
|
<dt id="protocol-PROTO"><b>protocol</b> = PROTO</dt>
|
|
<dd>
|
|
|
|
<p>application protocol to negotiate TLS</p>
|
|
|
|
<p>This option enables initial, protocol-specific negotiation of the TLS encryption. The <i>protocol</i> option should not be used with TLS encryption on a separate port.</p>
|
|
|
|
<p>Currently supported protocols:</p>
|
|
|
|
<dl>
|
|
|
|
<dt id="cifs"><i>cifs</i></dt>
|
|
<dd>
|
|
|
|
<p>Proprietary (undocummented) extension of CIFS protocol implemented in Samba. Support for this extension was dropped in Samba 3.0.0.</p>
|
|
|
|
</dd>
|
|
<dt id="connect"><i>connect</i></dt>
|
|
<dd>
|
|
|
|
<p>Based on RFC 2817 - <i>Upgrading to TLS Within HTTP/1.1</i>, section 5.2 - <i>Requesting a Tunnel with CONNECT</i></p>
|
|
|
|
<p>This protocol is only supported in client mode.</p>
|
|
|
|
</dd>
|
|
<dt id="imap"><i>imap</i></dt>
|
|
<dd>
|
|
|
|
<p>Based on RFC 2595 - <i>Using TLS with IMAP, POP3 and ACAP</i></p>
|
|
|
|
</dd>
|
|
<dt id="nntp"><i>nntp</i></dt>
|
|
<dd>
|
|
|
|
<p>Based on RFC 4642 - <i>Using Transport Layer Security (TLS) with Network News Transfer Protocol (NNTP)</i></p>
|
|
|
|
<p>This protocol is only supported in client mode.</p>
|
|
|
|
</dd>
|
|
<dt id="pgsql"><i>pgsql</i></dt>
|
|
<dd>
|
|
|
|
<p>Based on <i>http://www.postgresql.org/docs/8.3/static/protocol-flow.html#AEN73982</i></p>
|
|
|
|
</dd>
|
|
<dt id="pop3"><i>pop3</i></dt>
|
|
<dd>
|
|
|
|
<p>Based on RFC 2449 - <i>POP3 Extension Mechanism</i></p>
|
|
|
|
</dd>
|
|
<dt id="proxy"><i>proxy</i></dt>
|
|
<dd>
|
|
|
|
<p>Haproxy client IP address <i>http://haproxy.1wt.eu/download/1.5/doc/proxy-protocol.txt</i></p>
|
|
|
|
</dd>
|
|
<dt id="smtp"><i>smtp</i></dt>
|
|
<dd>
|
|
|
|
<p>Based on RFC 2487 - <i>SMTP Service Extension for Secure SMTP over TLS</i></p>
|
|
|
|
</dd>
|
|
<dt id="socks"><i>socks</i></dt>
|
|
<dd>
|
|
|
|
<p>SOCKS versions 4, 4a, and 5 are supported. The SOCKS protocol itself is encapsulated within TLS encryption layer to protect the final destination address.</p>
|
|
|
|
<p><i>http://www.openssh.com/txt/socks4.protocol</i></p>
|
|
|
|
<p><i>http://www.openssh.com/txt/socks4a.protocol</i></p>
|
|
|
|
<p>The BIND command of the SOCKS protocol is not supported. The USERID parameter is ignored.</p>
|
|
|
|
<p>See Examples section for sample configuration files for VPN based on SOCKS encryption.</p>
|
|
|
|
</dd>
|
|
</dl>
|
|
|
|
</dd>
|
|
<dt id="protocolAuthentication-AUTHENTICATION"><b>protocolAuthentication</b> = AUTHENTICATION</dt>
|
|
<dd>
|
|
|
|
<p>authentication type for the protocol negotiations</p>
|
|
|
|
<p>Currently, this option is only supported in the client-side 'connect' and 'smtp' protocols.</p>
|
|
|
|
<p>Supported authentication types for the 'connect' protocol are 'basic' or 'ntlm'. The default 'connect' authentication type is 'basic'.</p>
|
|
|
|
<p>Supported authentication types for the 'smtp' protocol are 'plain' or 'login'. The default 'smtp' authentication type is 'plain'.</p>
|
|
|
|
</dd>
|
|
<dt id="protocolDomain-DOMAIN"><b>protocolDomain</b> = DOMAIN</dt>
|
|
<dd>
|
|
|
|
<p>domain for the protocol negotiations</p>
|
|
|
|
<p>Currently, this option is only supported in the client-side 'connect' protocol.</p>
|
|
|
|
</dd>
|
|
<dt id="protocolHost-HOST:PORT"><b>protocolHost</b> = HOST:PORT</dt>
|
|
<dd>
|
|
|
|
<p>destination address for the protocol negotiations</p>
|
|
|
|
<p><i>protocolHost</i> specifies the final TLS server to be connected to by the proxy, and not the proxy server directly connected by <b>stunnel</b>. The proxy server should be specified with the 'connect' option.</p>
|
|
|
|
<p>Currently the protocol destination address only applies to the 'connect' protocol.</p>
|
|
|
|
</dd>
|
|
<dt id="protocolPassword-PASSWORD"><b>protocolPassword</b> = PASSWORD</dt>
|
|
<dd>
|
|
|
|
<p>password for the protocol negotiations</p>
|
|
|
|
<p>Currently, this option is only supported in the client-side 'connect' and 'smtp' protocols.</p>
|
|
|
|
</dd>
|
|
<dt id="protocolUsername-USERNAME"><b>protocolUsername</b> = USERNAME</dt>
|
|
<dd>
|
|
|
|
<p>username for the protocol negotiations</p>
|
|
|
|
<p>Currently, this option is only supported in the client-side 'connect' and 'smtp' protocols.</p>
|
|
|
|
</dd>
|
|
<dt id="PSKidentity-IDENTITY"><b>PSKidentity</b> = IDENTITY</dt>
|
|
<dd>
|
|
|
|
<p>PSK identity for the PSK client</p>
|
|
|
|
<p><i>PSKidentity</i> can be used on <b>stunnel</b> clients to select the PSK identity used for authentication. This option is ignored in server sections.</p>
|
|
|
|
<p>default: the first identity specified in the <i>PSKsecrets</i> file.</p>
|
|
|
|
</dd>
|
|
<dt id="PSKsecrets-FILE"><b>PSKsecrets</b> = FILE</dt>
|
|
<dd>
|
|
|
|
<p>file with PSK identities and corresponding keys</p>
|
|
|
|
<p>Each line of the file in the following format:</p>
|
|
|
|
<pre><code> IDENTITY:KEY</code></pre>
|
|
|
|
<p>The key is required to be at least 20 characters long. The file should not be world-readable nor world-writable.</p>
|
|
|
|
</dd>
|
|
<dt id="pty-yes-no-Unix-only"><b>pty</b> = yes | no (Unix only)</dt>
|
|
<dd>
|
|
|
|
<p>allocate a pseudoterminal for 'exec' option</p>
|
|
|
|
</dd>
|
|
<dt id="redirect-HOST:-PORT"><b>redirect</b> = [HOST:]PORT</dt>
|
|
<dd>
|
|
|
|
<p>redirect TLS client connections on certificate-based authentication failures</p>
|
|
|
|
<p>This option only works in server mode. Some protocol negotiations are also incompatible with the <i>redirect</i> option.</p>
|
|
|
|
</dd>
|
|
<dt id="renegotiation-yes-no"><b>renegotiation</b> = yes | no</dt>
|
|
<dd>
|
|
|
|
<p>support TLS renegotiation</p>
|
|
|
|
<p>Applications of the TLS renegotiation include some authentication scenarios, or re-keying long lasting connections.</p>
|
|
|
|
<p>On the other hand this feature can facilitate a trivial CPU-exhaustion DoS attack:</p>
|
|
|
|
<p><i>http://vincent.bernat.im/en/blog/2011-ssl-dos-mitigation.html</i></p>
|
|
|
|
<p>Please note that disabling TLS renegotiation does not fully mitigate this issue.</p>
|
|
|
|
<p>default: yes (if supported by <b>OpenSSL</b>)</p>
|
|
|
|
</dd>
|
|
<dt id="reset-yes-no"><b>reset</b> = yes | no</dt>
|
|
<dd>
|
|
|
|
<p>attempt to use the TCP RST flag to indicate an error</p>
|
|
|
|
<p>This option is not supported on some platforms.</p>
|
|
|
|
<p>default: yes</p>
|
|
|
|
</dd>
|
|
<dt id="retry-yes-no"><b>retry</b> = yes | no</dt>
|
|
<dd>
|
|
|
|
<p>reconnect a connect+exec section after it was disconnected</p>
|
|
|
|
<p>default: no</p>
|
|
|
|
</dd>
|
|
<dt id="requireCert-yes-no"><b>requireCert</b> = yes | no</dt>
|
|
<dd>
|
|
|
|
<p>require a client certificate for <i>verifyChain</i> or <i>verifyPeer</i></p>
|
|
|
|
<p>With <i>requireCert</i> set to <i>no</i>, the <b>stunnel</b> server accepts client connections that did not present a certificate.</p>
|
|
|
|
<p>Both <i>verifyChain = yes</i> and <i>verifyPeer = yes</i> imply <i>requireCert = yes</i>.</p>
|
|
|
|
<p>default: no</p>
|
|
|
|
</dd>
|
|
<dt id="setgid-GROUP-Unix-only"><b>setgid</b> = GROUP (Unix only)</dt>
|
|
<dd>
|
|
|
|
<p>Unix group id</p>
|
|
|
|
<p>As a global option: setgid() to the specified group in daemon mode and clear all other groups.</p>
|
|
|
|
<p>As a service-level option: set the group of the Unix socket specified with "accept".</p>
|
|
|
|
</dd>
|
|
<dt id="setuid-USER-Unix-only"><b>setuid</b> = USER (Unix only)</dt>
|
|
<dd>
|
|
|
|
<p>Unix user id</p>
|
|
|
|
<p>As a global option: setuid() to the specified user in daemon mode.</p>
|
|
|
|
<p>As a service-level option: set the owner of the Unix socket specified with "accept".</p>
|
|
|
|
</dd>
|
|
<dt id="sessionCacheSize-NUM_ENTRIES"><b>sessionCacheSize</b> = NUM_ENTRIES</dt>
|
|
<dd>
|
|
|
|
<p>session cache size</p>
|
|
|
|
<p><i>sessionCacheSize</i> specifies the maximum number of the internal session cache entries.</p>
|
|
|
|
<p>The value of 0 can be used for unlimited size. It is not recommended for production use due to the risk of a memory exhaustion DoS attack.</p>
|
|
|
|
</dd>
|
|
<dt id="sessionCacheTimeout-TIMEOUT"><b>sessionCacheTimeout</b> = TIMEOUT</dt>
|
|
<dd>
|
|
|
|
<p>session cache timeout</p>
|
|
|
|
<p>This is the number of seconds to keep cached TLS sessions.</p>
|
|
|
|
</dd>
|
|
<dt id="sessiond-HOST:PORT"><b>sessiond</b> = HOST:PORT</dt>
|
|
<dd>
|
|
|
|
<p>address of sessiond TLS cache server</p>
|
|
|
|
</dd>
|
|
<dt id="sni-SERVICE_NAME:SERVER_NAME_PATTERN-server-mode"><b>sni</b> = SERVICE_NAME:SERVER_NAME_PATTERN (server mode)</dt>
|
|
<dd>
|
|
|
|
<p>Use the service as a slave service (a name-based virtual server) for Server Name Indication TLS extension (RFC 3546).</p>
|
|
|
|
<p><i>SERVICE_NAME</i> specifies the master service that accepts client connections with the <i>accept</i> option. <i>SERVER_NAME_PATTERN</i> specifies the host name to be redirected. The pattern may start with the '*' character, e.g. '*.example.com'. Multiple slave services are normally specified for a single master service. The <i>sni</i> option can also be specified more than once within a single slave service.</p>
|
|
|
|
<p>This service, as well as the master service, may not be configured in client mode.</p>
|
|
|
|
<p>The <i>connect</i> option of the slave service is ignored when the <i>protocol</i> option is specified, as <i>protocol</i> connects to the remote host before TLS handshake.</p>
|
|
|
|
<p>Libwrap checks (Unix only) are performed twice: with the master service name after TCP connection is accepted, and with the slave service name during the TLS handshake.</p>
|
|
|
|
<p>The <i>sni</i> option is only available when compiled with <b>OpenSSL 1.0.0</b> and later.</p>
|
|
|
|
</dd>
|
|
<dt id="sni-SERVER_NAME-client-mode"><b>sni</b> = SERVER_NAME (client mode)</dt>
|
|
<dd>
|
|
|
|
<p>Use the parameter as the value of TLS Server Name Indication (RFC 3546) extension.</p>
|
|
|
|
<p>Empty SERVER_NAME disables sending the SNI extension.</p>
|
|
|
|
<p>The <i>sni</i> option is only available when compiled with <b>OpenSSL 1.0.0</b> and later.</p>
|
|
|
|
</dd>
|
|
<dt id="sslVersion-SSL_VERSION"><b>sslVersion</b> = SSL_VERSION</dt>
|
|
<dd>
|
|
|
|
<p>select the TLS protocol version</p>
|
|
|
|
<p>Supported values: all, SSLv2, SSLv3, TLSv1, TLSv1.1, TLSv1.2</p>
|
|
|
|
<p>Availability of specific protocols depends on the linked OpenSSL library. Older versions of OpenSSL do not support TLSv1.1 and TLSv1.2. Newer versions of OpenSSL do not support SSLv2.</p>
|
|
|
|
<p>Obsolete SSLv2 and SSLv3 are currently disabled by default. See the <b>options</b> option documentation for details.</p>
|
|
|
|
</dd>
|
|
<dt id="stack-BYTES-except-for-FORK-model"><b>stack</b> = BYTES (except for FORK model)</dt>
|
|
<dd>
|
|
|
|
<p>thread stack size</p>
|
|
|
|
</dd>
|
|
<dt id="TIMEOUTbusy-SECONDS"><b>TIMEOUTbusy</b> = SECONDS</dt>
|
|
<dd>
|
|
|
|
<p>time to wait for expected data</p>
|
|
|
|
</dd>
|
|
<dt id="TIMEOUTclose-SECONDS"><b>TIMEOUTclose</b> = SECONDS</dt>
|
|
<dd>
|
|
|
|
<p>time to wait for close_notify (set to 0 for buggy MSIE)</p>
|
|
|
|
</dd>
|
|
<dt id="TIMEOUTconnect-SECONDS"><b>TIMEOUTconnect</b> = SECONDS</dt>
|
|
<dd>
|
|
|
|
<p>time to wait to connect to a remote host</p>
|
|
|
|
</dd>
|
|
<dt id="TIMEOUTidle-SECONDS"><b>TIMEOUTidle</b> = SECONDS</dt>
|
|
<dd>
|
|
|
|
<p>time to keep an idle connection</p>
|
|
|
|
</dd>
|
|
<dt id="transparent-none-source-destination-both-Unix-only"><b>transparent</b> = none | source | destination | both (Unix only)</dt>
|
|
<dd>
|
|
|
|
<p>enable transparent proxy support on selected platforms</p>
|
|
|
|
<p>Supported values:</p>
|
|
|
|
<dl>
|
|
|
|
<dt id="none"><i>none</i></dt>
|
|
<dd>
|
|
|
|
<p>Disable transparent proxy support. This is the default.</p>
|
|
|
|
</dd>
|
|
<dt id="source"><i>source</i></dt>
|
|
<dd>
|
|
|
|
<p>Re-write the address to appear as if a wrapped daemon is connecting from the TLS client machine instead of the machine running <b>stunnel</b>.</p>
|
|
|
|
<p>This option is currently available in:</p>
|
|
|
|
<dl>
|
|
|
|
<dt id="Remote-mode-connect-option-on-Linux-2.6.28">Remote mode (<i>connect</i> option) on <i>Linux >=2.6.28</i></dt>
|
|
<dd>
|
|
|
|
<p>This configuration requires <b>stunnel</b> to be executed as root and without the <i>setuid</i> option.</p>
|
|
|
|
<p>This configuration requires the following setup for iptables and routing (possibly in /etc/rc.local or equivalent file):</p>
|
|
|
|
<pre><code> iptables -t mangle -N DIVERT
|
|
iptables -t mangle -A PREROUTING -p tcp -m socket -j DIVERT
|
|
iptables -t mangle -A DIVERT -j MARK --set-mark 1
|
|
iptables -t mangle -A DIVERT -j ACCEPT
|
|
ip rule add fwmark 1 lookup 100
|
|
ip route add local 0.0.0.0/0 dev lo table 100
|
|
echo 0 >/proc/sys/net/ipv4/conf/lo/rp_filter</code></pre>
|
|
|
|
<p><b>stunnel</b> must also to be executed as root and without the <i>setuid</i> option.</p>
|
|
|
|
</dd>
|
|
<dt id="Remote-mode-connect-option-on-Linux-2.2.x">Remote mode (<i>connect</i> option) on <i>Linux 2.2.x</i></dt>
|
|
<dd>
|
|
|
|
<p>This configuration requires the kernel to be compiled with the <i>transparent proxy</i> option. Connected service must be installed on a separate host. Routing towards the clients has to go through the <b>stunnel</b> box.</p>
|
|
|
|
<p><b>stunnel</b> must also to be executed as root and without the <i>setuid</i> option.</p>
|
|
|
|
</dd>
|
|
<dt id="Remote-mode-connect-option-on-FreeBSD-8.0">Remote mode (<i>connect</i> option) on <i>FreeBSD >=8.0</i></dt>
|
|
<dd>
|
|
|
|
<p>This configuration requires additional firewall and routing setup. <b>stunnel</b> must also to be executed as root and without the <i>setuid</i> option.</p>
|
|
|
|
</dd>
|
|
<dt id="Local-mode-exec-option">Local mode (<i>exec</i> option)</dt>
|
|
<dd>
|
|
|
|
<p>This configuration works by pre-loading the <i>libstunnel.so</i> shared library. _RLD_LIST environment variable is used on Tru64, and LD_PRELOAD variable on other platforms.</p>
|
|
|
|
</dd>
|
|
</dl>
|
|
|
|
</dd>
|
|
<dt id="destination"><i>destination</i></dt>
|
|
<dd>
|
|
|
|
<p>The original destination is used instead of the <i>connect</i> option.</p>
|
|
|
|
<p>A service section for transparent destination may look like this:</p>
|
|
|
|
<pre><code> [transparent]
|
|
client = yes
|
|
accept = <stunnel_port>
|
|
transparent = destination</code></pre>
|
|
|
|
<p>This configuration requires iptables setup to work, possibly in /etc/rc.local or equivalent file.</p>
|
|
|
|
<p>For a connect target installed on the same host:</p>
|
|
|
|
<pre><code> /sbin/iptables -t nat -I OUTPUT -p tcp --dport <redirected_port> \
|
|
-m ! --uid-owner <stunnel_user_id> \
|
|
-j DNAT --to-destination <local_ip>:<stunnel_port></code></pre>
|
|
|
|
<p>For a connect target installed on a remote host:</p>
|
|
|
|
<pre><code> /sbin/iptables -I INPUT -i eth0 -p tcp --dport <stunnel_port> -j ACCEPT
|
|
/sbin/iptables -t nat -I PREROUTING -p tcp --dport <redirected_port> \
|
|
-i eth0 -j DNAT --to-destination <local_ip>:<stunnel_port></code></pre>
|
|
|
|
<p>The transparent destination option is currently only supported on Linux.</p>
|
|
|
|
</dd>
|
|
<dt id="both"><i>both</i></dt>
|
|
<dd>
|
|
|
|
<p>Use both <i>source</i> and <i>destination</i> transparent proxy.</p>
|
|
|
|
</dd>
|
|
</dl>
|
|
|
|
<p>Two legacy options are also supported for backward compatibility:</p>
|
|
|
|
<dl>
|
|
|
|
<dt id="yes"><i>yes</i></dt>
|
|
<dd>
|
|
|
|
<p>This option has been renamed to <i>source</i>.</p>
|
|
|
|
</dd>
|
|
<dt id="no"><i>no</i></dt>
|
|
<dd>
|
|
|
|
<p>This option has been renamed to <i>none</i>.</p>
|
|
|
|
</dd>
|
|
</dl>
|
|
|
|
</dd>
|
|
<dt id="verify-LEVEL"><b>verify</b> = LEVEL</dt>
|
|
<dd>
|
|
|
|
<p>verify the peer certificate</p>
|
|
|
|
<p>This option is obsolete and should be replaced with the <i>verifyChain</i> and <i>verifyPeer</i> options.</p>
|
|
|
|
<dl>
|
|
|
|
<dt id="level-0">level 0</dt>
|
|
<dd>
|
|
|
|
<p>Request and ignore the peer certificate.</p>
|
|
|
|
</dd>
|
|
<dt id="level-1">level 1</dt>
|
|
<dd>
|
|
|
|
<p>Verify the peer certificate if present.</p>
|
|
|
|
</dd>
|
|
<dt id="level-2">level 2</dt>
|
|
<dd>
|
|
|
|
<p>Verify the peer certificate.</p>
|
|
|
|
</dd>
|
|
<dt id="level-3">level 3</dt>
|
|
<dd>
|
|
|
|
<p>Verify the peer against a locally installed certificate.</p>
|
|
|
|
</dd>
|
|
<dt id="level-4">level 4</dt>
|
|
<dd>
|
|
|
|
<p>Ignore the chain and only verify the peer certificate.</p>
|
|
|
|
</dd>
|
|
<dt id="default">default</dt>
|
|
<dd>
|
|
|
|
<p>No verify.</p>
|
|
|
|
</dd>
|
|
</dl>
|
|
|
|
</dd>
|
|
<dt id="verifyChain-yes-no"><b>verifyChain</b> = yes | no</dt>
|
|
<dd>
|
|
|
|
<p>verify the peer certificate chain starting from the root CA</p>
|
|
|
|
<p>For server certificate verification it is essential to also require a specific certificate with <i>checkHost</i> or <i>checkIP</i>.</p>
|
|
|
|
<p>The self-signed root CA certificate needs to be stored either in the file specified with <i>CAfile</i>, or in the directory specified with <i>CApath</i>.</p>
|
|
|
|
<p>default: no</p>
|
|
|
|
</dd>
|
|
<dt id="verifyPeer-yes-no"><b>verifyPeer</b> = yes | no</dt>
|
|
<dd>
|
|
|
|
<p>verify the peer certificate</p>
|
|
|
|
<p>The peer certificate needs to be stored either in the file specified with <i>CAfile</i>, or in the directory specified with <i>CApath</i>.</p>
|
|
|
|
<p>default: no</p>
|
|
|
|
</dd>
|
|
</dl>
|
|
|
|
<a href="#_podtop_"><h1 id="RETURN-VALUE">RETURN VALUE</h1></a>
|
|
|
|
<p><b>stunnel</b> returns zero on success, non-zero on error.</p>
|
|
|
|
<a href="#_podtop_"><h1 id="SIGNALS">SIGNALS</h1></a>
|
|
|
|
<p>The following signals can be used to control <b>stunnel</b> in Unix environment:</p>
|
|
|
|
<dl>
|
|
|
|
<dt id="SIGHUP">SIGHUP</dt>
|
|
<dd>
|
|
|
|
<p>Force a reload of the configuration file.</p>
|
|
|
|
<p>Some global options will not be reloaded:</p>
|
|
|
|
<ul>
|
|
|
|
<li><p>chroot</p>
|
|
|
|
</li>
|
|
<li><p>foreground</p>
|
|
|
|
</li>
|
|
<li><p>pid</p>
|
|
|
|
</li>
|
|
<li><p>setgid</p>
|
|
|
|
</li>
|
|
<li><p>setuid</p>
|
|
|
|
</li>
|
|
</ul>
|
|
|
|
<p>The use of the 'setuid' option will also prevent <b>stunnel</b> from binding to privileged (<1024) ports during configuration reloading.</p>
|
|
|
|
<p>When the 'chroot' option is used, <b>stunnel</b> will look for all its files (including the configuration file, certificates, the log file and the pid file) within the chroot jail.</p>
|
|
|
|
</dd>
|
|
<dt id="SIGUSR1">SIGUSR1</dt>
|
|
<dd>
|
|
|
|
<p>Close and reopen the <b>stunnel</b> log file. This function can be used for log rotation.</p>
|
|
|
|
</dd>
|
|
<dt id="SIGTERM-SIGQUIT-SIGINT">SIGTERM, SIGQUIT, SIGINT</dt>
|
|
<dd>
|
|
|
|
<p>Shut <b>stunnel</b> down.</p>
|
|
|
|
</dd>
|
|
</dl>
|
|
|
|
<p>The result of sending any other signals to the server is undefined.</p>
|
|
|
|
<a href="#_podtop_"><h1 id="EXAMPLES">EXAMPLES</h1></a>
|
|
|
|
<p>In order to provide TLS encapsulation to your local <i>imapd</i> service, use:</p>
|
|
|
|
<pre><code> [imapd]
|
|
accept = 993
|
|
exec = /usr/sbin/imapd
|
|
execArgs = imapd</code></pre>
|
|
|
|
<p>or in remote mode:</p>
|
|
|
|
<pre><code> [imapd]
|
|
accept = 993
|
|
connect = 143</code></pre>
|
|
|
|
<p>In order to let your local e-mail client connect to a TLS-enabled <i>imapd</i> service on another server, configure the e-mail client to connect to localhost on port 119 and use:</p>
|
|
|
|
<pre><code> [imap]
|
|
client = yes
|
|
accept = 143
|
|
connect = servername:993</code></pre>
|
|
|
|
<p>If you want to provide tunneling to your <i>pppd</i> daemon on port 2020, use something like:</p>
|
|
|
|
<pre><code> [vpn]
|
|
accept = 2020
|
|
exec = /usr/sbin/pppd
|
|
execArgs = pppd local
|
|
pty = yes</code></pre>
|
|
|
|
<p>If you want to use <b>stunnel</b> in <i>inetd</i> mode to launch your imapd process, you'd use this <i>stunnel.conf</i>. Note there must be no <i>[service_name]</i> section.</p>
|
|
|
|
<pre><code> exec = /usr/sbin/imapd
|
|
execArgs = imapd</code></pre>
|
|
|
|
<p>To setup SOCKS VPN configure the following client service:</p>
|
|
|
|
<pre><code> [socks_client]
|
|
client = yes
|
|
accept = 127.0.0.1:1080
|
|
connect = vpn_server:9080
|
|
verifyPeer = yes
|
|
CAfile = stunnel.pem</code></pre>
|
|
|
|
<p>The corresponding configuration on the vpn_server host:</p>
|
|
|
|
<pre><code> [socks_server]
|
|
protocol = socks
|
|
accept = 9080
|
|
cert = stunnel.pem
|
|
key = stunnel.key</code></pre>
|
|
|
|
<p>Now test your configuration on the client machine with:</p>
|
|
|
|
<pre><code> curl --socks4a localhost http://www.example.com/</code></pre>
|
|
|
|
<p>An example server mode SNI configuration:</p>
|
|
|
|
<pre><code> [virtual]
|
|
; master service
|
|
accept = 443
|
|
cert = default.pem
|
|
connect = default.internal.mydomain.com:8080
|
|
|
|
[sni1]
|
|
; slave service 1
|
|
sni = virtual:server1.mydomain.com
|
|
cert = server1.pem
|
|
connect = server1.internal.mydomain.com:8081
|
|
|
|
[sni2]
|
|
; slave service 2
|
|
sni = virtual:server2.mydomain.com
|
|
cert = server2.pem
|
|
connect = server2.internal.mydomain.com:8082
|
|
verifyPeer = yes
|
|
CAfile = server2-allowed-clients.pem</code></pre>
|
|
|
|
<p>An example of advanced engine configuration allows for authentication with private keys stored in the Windows certificate store (Windows only). With the CAPI engine you don't need to manually select the client key to use. The client key is automatically selected based on the list of CAs trusted by the server.</p>
|
|
|
|
<pre><code> engine = capi
|
|
|
|
[service]
|
|
engineId = capi
|
|
client = yes
|
|
accept = 127.0.0.1:8080
|
|
connect = example.com:8443</code></pre>
|
|
|
|
<p>An example of advanced engine configuration to use the certificate and the corresponding private key from a pkcs11 engine:</p>
|
|
|
|
<pre><code> engine = pkcs11
|
|
engineCtrl = MODULE_PATH:opensc-pkcs11.so
|
|
engineCtrl = PIN:123456
|
|
|
|
[service]
|
|
engineId = pkcs11
|
|
client = yes
|
|
accept = 127.0.0.1:8080
|
|
connect = example.com:843
|
|
cert = pkcs11:token=MyToken;object=MyCert
|
|
key = pkcs11:token=MyToken;object=MyKey</code></pre>
|
|
|
|
<p>An example of advanced engine configuration to use the certificate and the corresponding private key from a SoftHSM token:</p>
|
|
|
|
<pre><code> engine = pkcs11
|
|
engineCtrl = MODULE_PATH:softhsm2.dll
|
|
engineCtrl = PIN:12345
|
|
|
|
[service]
|
|
engineId = pkcs11
|
|
client = yes
|
|
accept = 127.0.0.1:8080
|
|
connect = example.com:843
|
|
cert = pkcs11:token=MyToken;object=KeyCert</code></pre>
|
|
|
|
<a href="#_podtop_"><h1 id="NOTES">NOTES</h1></a>
|
|
|
|
<h2 id="RESTRICTIONS">RESTRICTIONS</h2>
|
|
|
|
<p><b>stunnel</b> cannot be used for the FTP daemon because of the nature of the FTP protocol which utilizes multiple ports for data transfers. There are available TLS-enabled versions of FTP and telnet daemons, however.</p>
|
|
|
|
<h2 id="INETD-MODE">INETD MODE</h2>
|
|
|
|
<p>The most common use of <b>stunnel</b> is to listen on a network port and establish communication with either a new port via the connect option, or a new program via the <i>exec</i> option. However there is a special case when you wish to have some other program accept incoming connections and launch <b>stunnel</b>, for example with <i>inetd</i>, <i>xinetd</i>, or <i>tcpserver</i>.</p>
|
|
|
|
<p>For example, if you have the following line in <i>inetd.conf</i>:</p>
|
|
|
|
<pre><code> imaps stream tcp nowait root @bindir@/stunnel stunnel @sysconfdir@/stunnel/imaps.conf</code></pre>
|
|
|
|
<p>In these cases, the <i>inetd</i>-style program is responsible for binding a network socket (<i>imaps</i> above) and handing it to <b>stunnel</b> when a connection is received. Thus you do not want <b>stunnel</b> to have any <i>accept</i> option. All the <i>Service Level Options</i> should be placed in the global options section, and no <i>[service_name]</i> section will be present. See the <i>EXAMPLES</i> section for example configurations.</p>
|
|
|
|
<h2 id="CERTIFICATES">CERTIFICATES</h2>
|
|
|
|
<p>Each TLS-enabled daemon needs to present a valid X.509 certificate to the peer. It also needs a private key to decrypt the incoming data. The easiest way to obtain a certificate and a key is to generate them with the free <b>OpenSSL</b> package. You can find more information on certificates generation on pages listed below.</p>
|
|
|
|
<p>The order of contents of the <i>.pem</i> file is important. It should contain the unencrypted private key first, then a signed certificate (not certificate request). There should also be empty lines after the certificate and the private key. Any plaintext certificate information appended on the top of generated certificate should be discarded. So the file should look like this:</p>
|
|
|
|
<pre><code> -----BEGIN RSA PRIVATE KEY-----
|
|
[encoded key]
|
|
-----END RSA PRIVATE KEY-----
|
|
[empty line]
|
|
-----BEGIN CERTIFICATE-----
|
|
[encoded certificate]
|
|
-----END CERTIFICATE-----
|
|
[empty line]</code></pre>
|
|
|
|
<h2 id="RANDOMNESS">RANDOMNESS</h2>
|
|
|
|
<p><b>stunnel</b> needs to seed the PRNG (pseudo-random number generator) in order for TLS to use good randomness. The following sources are loaded in order until sufficient random data has been gathered:</p>
|
|
|
|
<ul>
|
|
|
|
<li><p>The file specified with the <i>RNDfile</i> flag.</p>
|
|
|
|
</li>
|
|
<li><p>The file specified by the RANDFILE environment variable, if set.</p>
|
|
|
|
</li>
|
|
<li><p>The file .rnd in your home directory, if RANDFILE not set.</p>
|
|
|
|
</li>
|
|
<li><p>The file specified with '--with-random' at compile time.</p>
|
|
|
|
</li>
|
|
<li><p>The contents of the screen if running on Windows.</p>
|
|
|
|
</li>
|
|
<li><p>The egd socket specified with the <i>EGD</i> flag.</p>
|
|
|
|
</li>
|
|
<li><p>The egd socket specified with '--with-egd-sock' at compile time.</p>
|
|
|
|
</li>
|
|
<li><p>The /dev/urandom device.</p>
|
|
|
|
</li>
|
|
</ul>
|
|
|
|
<p>Note that on Windows machines that do not have console user interaction (mouse movements, creating windows, etc.) the screen contents are not variable enough to be sufficient, and you should provide a random file for use with the <i>RNDfile</i> flag.</p>
|
|
|
|
<p>Note that the file specified with the <i>RNDfile</i> flag should contain random data -- that means it should contain different information each time <b>stunnel</b> is run. This is handled automatically unless the <i>RNDoverwrite</i> flag is used. If you wish to update this file manually, the <i>openssl rand</i> command in recent versions of <b>OpenSSL</b>, would be useful.</p>
|
|
|
|
<p>Important note: If /dev/urandom is available, <b>OpenSSL</b> often seeds the PRNG with it while checking the random state. On systems with /dev/urandom <b>OpenSSL</b> is likely to use it even though it is listed at the very bottom of the list above. This is the behaviour of <b>OpenSSL</b> and not <b>stunnel</b>.</p>
|
|
|
|
<h2 id="DH-PARAMETERS">DH PARAMETERS</h2>
|
|
|
|
<p><b>stunnel</b> 4.40 and later contains hardcoded 2048-bit DH parameters. Starting with <b>stunnel</b> 5.18, these hardcoded DH parameters are replaced every 24 hours with autogenerated temporary DH parameters. DH parameter generation may take several minutes.</p>
|
|
|
|
<p>Alternatively, it is possible to specify static DH parameters in the certificate file, which disables generating temporary DH parameters:</p>
|
|
|
|
<pre><code> openssl dhparam 2048 >> stunnel.pem</code></pre>
|
|
|
|
<a href="#_podtop_"><h1 id="FILES">FILES</h1></a>
|
|
|
|
<dl>
|
|
|
|
<dt id="sysconfdir-stunnel-stunnel.conf"><i>@sysconfdir@/stunnel/stunnel.conf</i></dt>
|
|
<dd>
|
|
|
|
<p><b>stunnel</b> configuration file</p>
|
|
|
|
</dd>
|
|
</dl>
|
|
|
|
<a href="#_podtop_"><h1 id="BUGS">BUGS</h1></a>
|
|
|
|
<p>The <i>execArgs</i> option and the Win32 command line do not support quoting.</p>
|
|
|
|
<a href="#_podtop_"><h1 id="SEE-ALSO">SEE ALSO</h1></a>
|
|
|
|
<dl>
|
|
|
|
<dt id="tcpd-8"><a href="http://man.he.net/man8/tcpd">tcpd(8)</a></dt>
|
|
<dd>
|
|
|
|
<p>access control facility for internet services</p>
|
|
|
|
</dd>
|
|
<dt id="inetd-8"><a href="http://man.he.net/man8/inetd">inetd(8)</a></dt>
|
|
<dd>
|
|
|
|
<p>internet 'super-server'</p>
|
|
|
|
</dd>
|
|
<dt id="http:-www.stunnel.org"><i>http://www.stunnel.org/</i></dt>
|
|
<dd>
|
|
|
|
<p><b>stunnel</b> homepage</p>
|
|
|
|
</dd>
|
|
<dt id="http:-www.openssl.org"><i>http://www.openssl.org/</i></dt>
|
|
<dd>
|
|
|
|
<p><b>OpenSSL</b> project website</p>
|
|
|
|
</dd>
|
|
</dl>
|
|
|
|
<a href="#_podtop_"><h1 id="AUTHOR">AUTHOR</h1></a>
|
|
|
|
<dl>
|
|
|
|
<dt id="Micha-Trojnara">Michał Trojnara</dt>
|
|
<dd>
|
|
|
|
<p><<i>Michal.Trojnara@stunnel.org</i>></p>
|
|
|
|
</dd>
|
|
</dl>
|
|
|
|
<table border="0" width="100%" cellspacing="0" cellpadding="3">
|
|
<tr><td class="_podblock_" style="background-color: #cccccc; color: #000" valign="middle">
|
|
<big><strong><span class="_podblock_"> stunnel TLS Proxy</span></strong></big>
|
|
</td></tr>
|
|
</table>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
|