source: postlfs/security/stunnel.xml@ 4d5c31d

10.0 10.1 11.0 7.10 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind ken/refactor-virt lazarus nosym perl-modules qt5new trunk upgradedb xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since 4d5c31d was 4d5c31d, checked in by Fernando de Oliveira <fernando@…>, 7 years ago

Update to stunnel-5.10. Thanks to Pierre for testing the build with binutils-2.25.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@15385 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 11.6 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!ENTITY stunnel-download-http "http://mirrors.zerg.biz/stunnel/stunnel-&stunnel-version;.tar.gz">
8 <!ENTITY stunnel-download-ftp "ftp://ftp.stunnel.org/stunnel/stunnel-&stunnel-version;.tar.gz">
9 <!ENTITY stunnel-md5sum "a0edda805eb7d6ea600a230fb0979ea1">
10 <!ENTITY stunnel-size "592 KB">
11 <!ENTITY stunnel-buildsize "6 MB">
12 <!ENTITY stunnel-time "0.1 SBU">
13]>
14
15<sect1 id="stunnel" xreflabel="stunnel-&stunnel-version;">
16 <?dbhtml filename="stunnel.html"?>
17
18 <sect1info>
19 <othername>$LastChangedBy$</othername>
20 <date>$Date$</date>
21 </sect1info>
22
23 <title>stunnel-&stunnel-version;</title>
24
25 <indexterm zone="stunnel">
26 <primary sortas="a-stunnel">stunnel</primary>
27 </indexterm>
28
29 <sect2 role="package">
30 <title>Introduction to stunnel</title>
31
32 <para>The <application>stunnel</application> package contains a program
33 that allows you to encrypt arbitrary TCP connections inside SSL (Secure
34 Sockets Layer) so you can easily communicate with clients over secure
35 channels. <application>stunnel</application> can be used to add SSL
36 functionality to commonly used <application>Inetd</application> daemons
37 like POP-2, POP-3, and IMAP servers, to standalone daemons like NNTP,
38 SMTP and HTTP, and in tunneling PPP over network sockets without changes
39 to the server package source code.</para>
40
41 &lfs76_checked;
42
43 <bridgehead renderas="sect3">Package Information</bridgehead>
44 <itemizedlist spacing="compact">
45 <listitem>
46 <para>Download (HTTP): <ulink url="&stunnel-download-http;"/></para>
47 </listitem>
48 <listitem>
49 <para>Download (FTP): <ulink url="&stunnel-download-ftp;"/></para>
50 </listitem>
51 <listitem>
52 <para>Download MD5 sum: &stunnel-md5sum;</para>
53 </listitem>
54 <listitem>
55 <para>Download size: &stunnel-size;</para>
56 </listitem>
57 <listitem>
58 <para>Estimated disk space required: &stunnel-buildsize;</para>
59 </listitem>
60 <listitem>
61 <para>Estimated build time: &stunnel-time;</para>
62 </listitem>
63 </itemizedlist>
64
65 <bridgehead renderas="sect3">stunnel Dependencies</bridgehead>
66
67 <bridgehead renderas="sect4">Required</bridgehead>
68 <para role="required">
69 <xref linkend="openssl"/>
70 </para>
71
72 <bridgehead renderas="sect4">Optional</bridgehead>
73 <para role="optional">
74 <ulink url="ftp://ftp.porcupine.org/pub/security/">tcpwrappers</ulink> and
75 <ulink url="https://dist.torproject.org/">TOR</ulink>
76 </para>
77
78 <para condition="html" role="usernotes">User Notes:
79 <ulink url="&blfs-wiki;/stunnel"/></para>
80
81 </sect2>
82
83 <sect2 role="installation">
84 <title>Installation of stunnel</title>
85
86 <para>The <command>stunnel</command> daemon will be run in a
87 <command>chroot</command> jail by an unprivileged user. Create the
88 new user and group using the following commands as the
89 <systemitem class="username">root</systemitem> user:</para>
90
91<screen role="root"><userinput>groupadd -g 51 stunnel &amp;&amp;
92useradd -c "stunnel Daemon" -d /var/lib/stunnel \
93 -g stunnel -s /bin/false -u 51 stunnel</userinput></screen>
94
95 <note>
96 <para>A signed SSL Certificate and a Private Key is necessary to run the
97 <command>stunnel</command> daemon. Further below, after
98 <command>make ... install</command>, we include instructions to generate
99 them. However, if you own, or have already created a signed SSL
100 Certificate you wish to use, copy it to
101 <filename>/etc/stunnel/stunnel.pem</filename> before starting the build
102 (ensure only <systemitem class="username">root</systemitem> has read and
103 write access). The <filename class="extension">.pem</filename> file must
104 be formatted as shown below:</para>
105
106<screen><literal>-----BEGIN PRIVATE KEY-----
107<replaceable>&lt;many encrypted lines of private key&gt;</replaceable>
108-----END PRIVATE KEY-----
109-----BEGIN CERTIFICATE-----
110<replaceable>&lt;many encrypted lines of certificate&gt;</replaceable>
111-----END CERTIFICATE-----
112-----BEGIN DH PARAMETERS-----
113<replaceable>&lt;encrypted lines of dh parms&gt;</replaceable>
114-----END DH PARAMETERS-----</literal></screen>
115 </note>
116
117 <para>There is a configure problem, if system
118 <application>binutils</application> version is older than
119 <application>binutils-2.25</application>. In this case, either use:</para>
120
121<screen><userinput>sed -i '/LDFLAGS.*static_flag/ s/^/#/' configure</userinput></screen>
122
123 <para>or, if <xref linkend="llvm"/> with Clang is installed, you can
124 replace <command>./configure ... </command> with <command>CC=clang
125 ./configure ... </command> in the first command bellow.</para>
126
127 <para>Install <application>stunnel</application> by running the following
128 commands:</para>
129
130<screen><userinput>./configure --prefix=/usr \
131 --sysconfdir=/etc \
132 --localstatedir=/var \
133 --disable-systemd &amp;&amp;
134make</userinput></screen>
135
136 <para>This package does not come with a test suite.</para>
137
138 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
139
140<screen role="root"><userinput>make docdir=/usr/share/doc/stunnel-&stunnel-version; install</userinput></screen>
141
142 <para>To create the <filename>stunnel.pem</filename> in the
143 <filename class="directory">/etc/stunnel</filename> directory,
144 you need to create one. The following command prompts you
145 for the necessary information. Ensure you reply to the</para>
146
147<screen><prompt>Common Name (FQDN of your server) [localhost]:</prompt></screen>
148
149 <para>prompt with the name or IP address you will be using
150 to access the service(s).</para>
151
152 <para>To generate a certificate, as the
153 <systemitem class="username">root</systemitem> user, run:</para>
154
155<screen role="root"><userinput>make cert</userinput></screen>
156
157 </sect2>
158
159 <sect2 role="commands">
160 <title>Command Explanations</title>
161
162 <para><parameter>--disable-systemd</parameter>: This switch disables
163 systemd socket activation support, not available in BLFS.</para>
164
165 <para><command>make docdir=... install</command>: This command installs the
166 package, changes the documentation installation directory to standard
167 naming conventions.</para>
168
169 </sect2>
170
171 <sect2 role="configuration">
172 <title>Configuring stunnel</title>
173
174 <sect3 id="stunnel-config">
175 <title>Config Files</title>
176
177 <para><filename>/etc/stunnel/stunnel.conf</filename></para>
178
179 <indexterm zone="stunnel stunnel-config">
180 <primary sortas="e-etc-stunnel-stunnel.conf">/etc/stunnel/stunnel.conf</primary>
181 </indexterm>
182
183 </sect3>
184
185 <sect3>
186 <title>Configuration Information</title>
187
188 <para>As the <systemitem class="username">root</systemitem> user,
189 create the directory used for the
190 <filename class="extension">.pid</filename> file that is created
191 when the <application>stunnel</application> daemon starts:</para>
192
193<screen role="root"><userinput>install -v -m750 -o stunnel -g stunnel -d /var/lib/stunnel/run &amp;&amp;
194chown stunnel:stunnel /var/lib/stunnel</userinput></screen>
195
196 <para>Next, create a basic <filename>/etc/stunnel/stunnel.conf</filename>
197 configuration file using the following commands as the
198 <systemitem class="username">root</systemitem> user:</para>
199
200<screen role="root"><userinput>cat &gt;/etc/stunnel/stunnel.conf &lt;&lt; "EOF" &amp;&amp;
201<literal>; File: /etc/stunnel/stunnel.conf
202
203; Note: The pid and output locations are relative to the chroot location.
204
205pid = /run/stunnel.pid
206chroot = /var/lib/stunnel
207client = no
208setuid = stunnel
209setgid = stunnel
210cert = /etc/stunnel/stunnel.pem
211
212;debug = 7
213;output = stunnel.log
214
215;[https]
216;accept = 443
217;connect = 80
218;; "TIMEOUTclose = 0" is a workaround for a design flaw in Microsoft SSL
219;; Microsoft implementations do not use SSL close-notify alert and thus
220;; they are vulnerable to truncation attacks
221;TIMEOUTclose = 0</literal>
222
223EOF
224chmod -v 644 /etc/stunnel/stunnel.conf</userinput></screen>
225
226 <para>Finally, you need to add the service(s) you wish to encrypt to the
227 configuration file. The format is as follows:</para>
228
229<screen><literal>[<replaceable>&lt;service&gt;</replaceable>]
230accept = <replaceable>&lt;hostname:portnumber&gt;</replaceable>
231connect = <replaceable>&lt;hostname:portnumber&gt;</replaceable></literal></screen>
232
233 <para>If you use <application>stunnel</application> to encrypt a daemon
234 started from <command>[x]inetd</command>, you may need to disable that
235 daemon in the <filename>/etc/[x]inetd.conf</filename> file and enable a
236 corresponding <replaceable>&lt;service&gt;</replaceable>_stunnel service. You
237 may have to add an appropriate entry in <filename>/etc/services</filename>
238 as well.</para>
239
240 <para>For a full explanation of the commands and syntax used in the
241 configuration file, run <command>man stunnel</command>.</para>
242
243 </sect3>
244
245 <sect3 id="stunnel-init">
246 <title>Boot Script</title>
247
248 <para>To automatically start the <command>stunnel</command> daemon
249 when the system is rebooted, install the
250 <filename>/etc/rc.d/init.d/stunnel</filename> bootscript from the
251 <xref linkend="bootscripts"/> package.</para>
252
253 <indexterm zone="stunnel stunnel-init">
254 <primary sortas="f-stunnel">stunnel</primary>
255 </indexterm>
256
257<screen role="root"><userinput>make install-stunnel</userinput></screen>
258
259 </sect3>
260
261 </sect2>
262
263 <sect2 role="content">
264 <title>Contents</title>
265
266 <segmentedlist>
267 <segtitle>Installed Programs</segtitle>
268 <segtitle>Installed Library</segtitle>
269 <segtitle>Installed Directories</segtitle>
270
271 <seglistitem>
272 <seg>stunnel and stunnel3</seg>
273 <seg>libstunnel.so</seg>
274 <seg>/etc/stunnel,
275 /usr/lib/stunnel,
276 /usr/share/doc/stunnel-&stunnel-version;, and
277 /var/lib/stunnel</seg>
278 </seglistitem>
279 </segmentedlist>
280
281 <variablelist>
282 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
283 <?dbfo list-presentation="list"?>
284 <?dbhtml list-presentation="table"?>
285
286 <varlistentry id="stunnel-prog">
287 <term><command>stunnel</command></term>
288 <listitem>
289 <para> is a program designed to work as an SSL
290 encryption wrapper between remote clients and local
291 (<command>{x}inetd</command>-startable) or remote servers.</para>
292 <indexterm zone="stunnel stunnel-prog">
293 <primary sortas="b-stunnel">stunnel</primary>
294 </indexterm>
295 </listitem>
296 </varlistentry>
297
298 <varlistentry id="stunnel3">
299 <term><command>stunnel3</command></term>
300 <listitem>
301 <para>is a <application>Perl</application> wrapper script to use
302 <command>stunnel</command> 3.x syntax with <command>stunnel</command>
303 >=4.05.</para>
304 <indexterm zone="stunnel stunnel3">
305 <primary sortas="b-stunnel3">stunnel3</primary>
306 </indexterm>
307 </listitem>
308 </varlistentry>
309
310 <varlistentry id="libstunnel">
311 <term><filename class='libraryfile'>libstunnel.so</filename></term>
312 <listitem>
313 <para> contains the API functions required by
314 <application>stunnel</application>.</para>
315 <indexterm zone="stunnel libstunnel">
316 <primary sortas="c-libstunnel">libstunnel.so</primary>
317 </indexterm>
318 </listitem>
319 </varlistentry>
320
321 </variablelist>
322
323 </sect2>
324
325</sect1>
Note: See TracBrowser for help on using the repository browser.