[2a7d6c3e] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[ff769b8c] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
---|
[2a7d6c3e] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[423b1d94] | 7 | <!-- <!ENTITY stunnel-download-http "http://www.stunnel.org/download/stunnel/src/stunnel-&stunnel-version;.tar.gz"> -->
|
---|
[884db0e3] | 8 | <!ENTITY stunnel-download-http "http://www.stunnel.org/download/stunnel/src/stunnel-&stunnel-version;.tar.gz">
|
---|
[423b1d94] | 9 | <!ENTITY stunnel-download-ftp "ftp://stunnel.mirt.net/stunnel/stunnel-&stunnel-version;.tar.gz">
|
---|
[50d61ed] | 10 | <!ENTITY stunnel-md5sum "253c50435d4d81cba6f19ca34266e6dc">
|
---|
[423b1d94] | 11 | <!ENTITY stunnel-size "484 KB">
|
---|
[50d61ed] | 12 | <!ENTITY stunnel-buildsize "4.0 MB">
|
---|
| 13 | <!ENTITY stunnel-time "0.1 SBU">
|
---|
[2a7d6c3e] | 14 | ]>
|
---|
| 15 |
|
---|
[0b5a693] | 16 | <sect1 id="stunnel" xreflabel="Stunnel-&stunnel-version;">
|
---|
[d3469f0] | 17 | <?dbhtml filename="stunnel.html"?>
|
---|
| 18 |
|
---|
| 19 | <sect1info>
|
---|
| 20 | <othername>$LastChangedBy$</othername>
|
---|
| 21 | <date>$Date$</date>
|
---|
[e19ad480] | 22 | <keywordset>
|
---|
| 23 | <keyword role="package">stunnel-&stunnel-version;.tar</keyword>
|
---|
[9084c2eb] | 24 | <keyword role="ftpdir">stunnel</keyword>
|
---|
[e19ad480] | 25 | </keywordset>
|
---|
[d3469f0] | 26 | </sect1info>
|
---|
| 27 |
|
---|
| 28 | <title>Stunnel-&stunnel-version;</title>
|
---|
| 29 |
|
---|
| 30 | <indexterm zone="stunnel">
|
---|
| 31 | <primary sortas="a-Stunnel">Stunnel</primary>
|
---|
| 32 | </indexterm>
|
---|
| 33 |
|
---|
| 34 | <sect2 role="package">
|
---|
| 35 | <title>Introduction to Stunnel</title>
|
---|
| 36 |
|
---|
| 37 | <para>The <application>Stunnel</application> package contains a program
|
---|
| 38 | that allows you to encrypt arbitrary TCP connections inside SSL (Secure
|
---|
| 39 | Sockets Layer) so you can easily communicate with clients over secure
|
---|
| 40 | channels. <application>Stunnel</application> can be used to add SSL
|
---|
| 41 | functionality to commonly used <application>Inetd</application> daemons
|
---|
| 42 | like POP-2, POP-3, and IMAP servers, to standalone daemons like NNTP,
|
---|
| 43 | SMTP and HTTP, and in tunneling PPP over network sockets without changes
|
---|
| 44 | to the server package source code.</para>
|
---|
| 45 |
|
---|
| 46 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 47 | <itemizedlist spacing="compact">
|
---|
| 48 | <listitem>
|
---|
| 49 | <para>Download (HTTP): <ulink url="&stunnel-download-http;"/></para>
|
---|
| 50 | </listitem>
|
---|
| 51 | <listitem>
|
---|
| 52 | <para>Download (FTP): <ulink url="&stunnel-download-ftp;"/></para>
|
---|
| 53 | </listitem>
|
---|
| 54 | <listitem>
|
---|
| 55 | <para>Download MD5 sum: &stunnel-md5sum;</para>
|
---|
| 56 | </listitem>
|
---|
| 57 | <listitem>
|
---|
| 58 | <para>Download size: &stunnel-size;</para>
|
---|
| 59 | </listitem>
|
---|
| 60 | <listitem>
|
---|
| 61 | <para>Estimated disk space required: &stunnel-buildsize;</para>
|
---|
| 62 | </listitem>
|
---|
| 63 | <listitem>
|
---|
| 64 | <para>Estimated build time: &stunnel-time;</para>
|
---|
| 65 | </listitem>
|
---|
| 66 | </itemizedlist>
|
---|
| 67 |
|
---|
[50d61ed] | 68 | <!-- <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
[d3469f0] | 69 | <itemizedlist spacing="compact">
|
---|
| 70 | <listitem>
|
---|
| 71 | <para>Required patch: <ulink
|
---|
| 72 | url="ftp://stunnel.mirt.net/stunnel/stunnel-&stunnel-version;-1_minute_sleep_fix.patch"/></para>
|
---|
| 73 | </listitem>
|
---|
[50d61ed] | 74 | </itemizedlist> -->
|
---|
[d3469f0] | 75 |
|
---|
| 76 | <bridgehead renderas="sect3">Stunnel Dependencies</bridgehead>
|
---|
| 77 |
|
---|
| 78 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
[e19ad480] | 79 | <para role="required"><xref linkend="openssl"/></para>
|
---|
[d3469f0] | 80 |
|
---|
| 81 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
[e19ad480] | 82 | <para role="optional"><xref linkend="tcpwrappers"/></para>
|
---|
[d3469f0] | 83 |
|
---|
| 84 | </sect2>
|
---|
| 85 |
|
---|
| 86 | <sect2 role="installation">
|
---|
| 87 | <title>Installation of Stunnel</title>
|
---|
| 88 |
|
---|
| 89 | <para>The <command>stunnel</command> daemon will be run in a
|
---|
| 90 | <command>chroot</command> jail by an unprivileged user. Create the
|
---|
| 91 | new user, group and <command>chroot</command> home directory structure
|
---|
[50d61ed] | 92 | using the following commands as the
|
---|
| 93 | <systemitem class="username">root</systemitem> user:</para>
|
---|
[d3469f0] | 94 |
|
---|
[b785ab29] | 95 | <screen role="root"><userinput>groupadd -g 51 stunnel &&
|
---|
[8d9eb0f] | 96 | useradd -c "Stunnel Daemon" -d /var/lib/stunnel \
|
---|
[b785ab29] | 97 | -g stunnel -s /bin/false -u 51 stunnel &&
|
---|
[50d61ed] | 98 | install -v -m700 -o stunnel -g stunnel -d /var/lib/stunnel/run</userinput></screen>
|
---|
[d3469f0] | 99 |
|
---|
| 100 | <note>
|
---|
| 101 | <para>A signed SSL Certificate and a Private Key is necessary to run
|
---|
| 102 | the <command>stunnel</command> daemon. If you own, or have already
|
---|
| 103 | created a signed SSL Certificate you wish to use, copy it to
|
---|
[50d61ed] | 104 | <filename>/etc/stunnel/stunnel.pem</filename> before starting the build
|
---|
[823b1a3] | 105 | (ensure only <systemitem class='username'>root</systemitem> has read and
|
---|
| 106 | write access), otherwise you will be
|
---|
[50d61ed] | 107 | prompted to create one during the installation process. The
|
---|
| 108 | <filename>.pem</filename> file must be formatted as shown below:</para>
|
---|
[d3469f0] | 109 |
|
---|
| 110 | <screen><literal>-----BEGIN RSA PRIVATE KEY-----
|
---|
[2a7d6c3e] | 111 | <replaceable>[many encrypted lines of unencrypted key]</replaceable>
|
---|
| 112 | -----END RSA PRIVATE KEY-----
|
---|
| 113 | -----BEGIN CERTIFICATE-----
|
---|
| 114 | <replaceable>[many encrypted lines of certificate]</replaceable>
|
---|
[50d61ed] | 115 | -----END CERTIFICATE-----
|
---|
| 116 | -----BEGIN DH PARAMETERS-----
|
---|
| 117 | <replaceable>[multiple encrypted lines of DH parameters]</replaceable>
|
---|
| 118 | -----END DH PARAMETERS-----</literal></screen>
|
---|
[d3469f0] | 119 | </note>
|
---|
[2a7d6c3e] | 120 |
|
---|
[d3469f0] | 121 | <para>Install <application>Stunnel</application> by running the following
|
---|
| 122 | commands:</para>
|
---|
| 123 |
|
---|
[50d61ed] | 124 | <screen><userinput>./configure --prefix=/usr --sysconfdir=/etc \
|
---|
[a49d0f2d] | 125 | --localstatedir=/var/lib --disable-libwrap &&
|
---|
[d3469f0] | 126 | make</userinput></screen>
|
---|
| 127 |
|
---|
[50d61ed] | 128 | <para>This package does not come with a test suite.</para>
|
---|
| 129 |
|
---|
[d3469f0] | 130 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
[305e60de] | 131 |
|
---|
[d3469f0] | 132 | <screen role="root"><userinput>make install</userinput></screen>
|
---|
[305e60de] | 133 |
|
---|
[d3469f0] | 134 | </sect2>
|
---|
[2a7d6c3e] | 135 |
|
---|
[d3469f0] | 136 | <sect2 role="commands">
|
---|
| 137 | <title>Command Explanations</title>
|
---|
[2a7d6c3e] | 138 |
|
---|
[d3469f0] | 139 | <para><parameter>--sysconfdir=/etc</parameter>: This parameter forces
|
---|
| 140 | the configuration directory to <filename class='directory'>/etc</filename>
|
---|
| 141 | instead of <filename class='directory'>/usr/etc</filename>.</para>
|
---|
[2a7d6c3e] | 142 |
|
---|
[d3469f0] | 143 | <para><parameter>--localstatedir=/var/lib</parameter>: This parameter
|
---|
| 144 | causes the installation process to create
|
---|
| 145 | <filename class='directory'>/var/lib/stunnel</filename> instead of
|
---|
| 146 | <filename class='directory'>/usr/var/stunnel</filename>.</para>
|
---|
[2a7d6c3e] | 147 |
|
---|
[a49d0f2d] | 148 | <para><parameter>--disable-libwrap</parameter>: This parameter is required
|
---|
| 149 | if you don't have <application>tcpwrappers</application> installed. Remove
|
---|
| 150 | the parameter if <application>tcpwrappers</application> is installed.</para>
|
---|
| 151 |
|
---|
[d3469f0] | 152 | <para><command>make install</command>: This command installs the package
|
---|
| 153 | and, if you did not copy an <filename>stunnel.pem</filename> file to the
|
---|
| 154 | <filename class='directory'>/etc/stunnel</filename> directory, prompts you
|
---|
| 155 | for the necessary information to create one. Ensure you reply to the</para>
|
---|
[0ef1837] | 156 |
|
---|
[d3469f0] | 157 | <screen><prompt>Common Name (FQDN of your server) [localhost]:</prompt></screen>
|
---|
[2a7d6c3e] | 158 |
|
---|
[d3469f0] | 159 | <para>prompt with the name or IP address you will be using
|
---|
[50d61ed] | 160 | to access the service(s).</para>
|
---|
[2a7d6c3e] | 161 |
|
---|
[d3469f0] | 162 | </sect2>
|
---|
[2a7d6c3e] | 163 |
|
---|
[d3469f0] | 164 | <sect2 role="configuration">
|
---|
| 165 | <title>Configuring Stunnel</title>
|
---|
[2a7d6c3e] | 166 |
|
---|
[d3469f0] | 167 | <sect3 id="stunnel-config">
|
---|
| 168 | <title>Config Files</title>
|
---|
[2a7d6c3e] | 169 |
|
---|
[d3469f0] | 170 | <para><filename>/etc/stunnel/stunnel.conf</filename></para>
|
---|
[2a7d6c3e] | 171 |
|
---|
[d3469f0] | 172 | <indexterm zone="stunnel stunnel-config">
|
---|
| 173 | <primary sortas="e-etc-stunnel-stunnel.conf">/etc/stunnel/stunnel.conf</primary>
|
---|
| 174 | </indexterm>
|
---|
[2a7d6c3e] | 175 |
|
---|
[d3469f0] | 176 | </sect3>
|
---|
[2a7d6c3e] | 177 |
|
---|
[d3469f0] | 178 | <sect3>
|
---|
| 179 | <title>Configuration Information</title>
|
---|
| 180 |
|
---|
| 181 | <para>Create a basic <filename>/etc/stunnel/stunnel.conf</filename>
|
---|
| 182 | configuration file using the following commands:</para>
|
---|
| 183 |
|
---|
| 184 | <screen role="root"><userinput>cat >/etc/stunnel/stunnel.conf << "EOF"
|
---|
| 185 | <literal># File: /etc/stunnel/stunnel.conf
|
---|
[2a7d6c3e] | 186 |
|
---|
| 187 | pid = /run/stunnel.pid
|
---|
| 188 | chroot = /var/lib/stunnel
|
---|
| 189 | client = no
|
---|
| 190 | setuid = stunnel
|
---|
[d3469f0] | 191 | setgid = stunnel</literal>
|
---|
[2a7d6c3e] | 192 |
|
---|
[d3469f0] | 193 | EOF</userinput></screen>
|
---|
[2a7d6c3e] | 194 |
|
---|
[50d61ed] | 195 | <para>Next, you need to add the service(s) you wish to encrypt to the
|
---|
[d3469f0] | 196 | configuration file. The format is as follows:</para>
|
---|
[2a7d6c3e] | 197 |
|
---|
[d3469f0] | 198 | <screen><literal>[<replaceable>[service]</replaceable>]
|
---|
[2a7d6c3e] | 199 | accept = <replaceable>[hostname:portnumber]</replaceable>
|
---|
[d3469f0] | 200 | connect = <replaceable>[hostname:portnumber]</replaceable></literal></screen>
|
---|
| 201 |
|
---|
| 202 | <para>If you use <application>Stunnel</application> to encrypt a daemon
|
---|
| 203 | started from <command>[x]inetd</command>, you may need to disable that
|
---|
| 204 | daemon in the <filename>/etc/[x]inetd.conf</filename> file and enable a
|
---|
| 205 | corresponding <replaceable>[service]</replaceable>_stunnel service. You
|
---|
| 206 | may have to add an appropriate entry in <filename>/etc/services</filename>
|
---|
| 207 | as well.</para>
|
---|
| 208 |
|
---|
| 209 | <para>For a full explanation of the commands and syntax used in the
|
---|
| 210 | configuration file, run <command>man stunnel</command>. To see a
|
---|
| 211 | BLFS example of an actual setup of an <command>stunnel</command> encrypted
|
---|
| 212 | service, read the <xref linkend="samba3-swat-config"/> in the
|
---|
| 213 | <application>Samba</application> instructions.</para>
|
---|
| 214 |
|
---|
| 215 | </sect3>
|
---|
| 216 |
|
---|
| 217 | <sect3 id="stunnel-init">
|
---|
| 218 | <title>Boot Script</title>
|
---|
| 219 |
|
---|
| 220 | <para>To automatically start the <command>stunnel</command> daemon
|
---|
| 221 | when the system is rebooted, install the
|
---|
| 222 | <filename>/etc/rc.d/init.d/stunnel</filename> bootscript from the
|
---|
| 223 | <xref linkend="intro-important-bootscripts"/> package.</para>
|
---|
| 224 |
|
---|
| 225 | <indexterm zone="stunnel stunnel-init">
|
---|
| 226 | <primary sortas="f-stunnel">stunnel</primary>
|
---|
| 227 | </indexterm>
|
---|
| 228 |
|
---|
| 229 | <screen role="root"><userinput>make install-stunnel</userinput></screen>
|
---|
| 230 |
|
---|
| 231 | </sect3>
|
---|
| 232 |
|
---|
| 233 | </sect2>
|
---|
| 234 |
|
---|
| 235 | <sect2 role="content">
|
---|
| 236 | <title>Contents</title>
|
---|
| 237 |
|
---|
| 238 | <segmentedlist>
|
---|
| 239 | <segtitle>Installed Programs</segtitle>
|
---|
| 240 | <segtitle>Installed Library</segtitle>
|
---|
| 241 | <segtitle>Installed Directories</segtitle>
|
---|
| 242 |
|
---|
| 243 | <seglistitem>
|
---|
| 244 | <seg>stunnel and stunnel3</seg>
|
---|
| 245 | <seg>libstunnel.so</seg>
|
---|
| 246 | <seg>/etc/stunnel, /var/lib/stunnel, and /usr/share/doc/stunnel</seg>
|
---|
| 247 | </seglistitem>
|
---|
| 248 | </segmentedlist>
|
---|
| 249 |
|
---|
| 250 | <variablelist>
|
---|
| 251 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 252 | <?dbfo list-presentation="list"?>
|
---|
[869b15ae] | 253 | <?dbhtml list-presentation="table"?>
|
---|
[d3469f0] | 254 |
|
---|
| 255 | <varlistentry id="stunnel-prog">
|
---|
| 256 | <term><command>stunnel</command></term>
|
---|
| 257 | <listitem>
|
---|
| 258 | <para> is a program designed to work as an SSL
|
---|
| 259 | encryption wrapper between remote clients and local
|
---|
| 260 | (<command>[x]inetd</command>-startable) or remote servers.</para>
|
---|
| 261 | <indexterm zone="stunnel stunnel-prog">
|
---|
| 262 | <primary sortas="b-stunnel">stunnel</primary>
|
---|
| 263 | </indexterm>
|
---|
| 264 | </listitem>
|
---|
| 265 | </varlistentry>
|
---|
| 266 |
|
---|
| 267 | <varlistentry id="stunnel3">
|
---|
| 268 | <term><command>stunnel3</command></term>
|
---|
| 269 | <listitem>
|
---|
| 270 | <para>is a <application>Perl</application> wrapper script to use
|
---|
| 271 | <command>stunnel</command> 3.x syntax with <command>stunnel</command>
|
---|
| 272 | >=4.05.</para>
|
---|
| 273 | <indexterm zone="stunnel stunnel3">
|
---|
| 274 | <primary sortas="b-stunnel3">stunnel3</primary>
|
---|
| 275 | </indexterm>
|
---|
| 276 | </listitem>
|
---|
| 277 | </varlistentry>
|
---|
| 278 |
|
---|
| 279 | <varlistentry id="libstunnel">
|
---|
| 280 | <term><filename class='libraryfile'>libstunnel.so</filename></term>
|
---|
| 281 | <listitem>
|
---|
| 282 | <para> contains the API functions required by
|
---|
| 283 | <application>Stunnel</application>.</para>
|
---|
| 284 | <indexterm zone="stunnel libstunnel">
|
---|
| 285 | <primary sortas="c-libstunnel">libstunnel.so</primary>
|
---|
| 286 | </indexterm>
|
---|
| 287 | </listitem>
|
---|
| 288 | </varlistentry>
|
---|
| 289 |
|
---|
| 290 | </variablelist>
|
---|
| 291 |
|
---|
| 292 | </sect2>
|
---|
[2a7d6c3e] | 293 |
|
---|
| 294 | </sect1>
|
---|