source: postlfs/security/stunnel.xml@ be88b64

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since be88b64 was be88b64, checked in by Fernando de Oliveira <fernando@…>, 9 years ago

Update to stunnel-5.17.
Some gcc-5 tags.

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

  • Property mode set to 100644
File size: 11.7 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 "https://www.stunnel.org/downloads/stunnel-&stunnel-version;.tar.gz">
8 <!ENTITY stunnel-download-ftp "ftp://ftp.stunnel.org/stunnel/stunnel-&stunnel-version;.tar.gz">
9 <!ENTITY stunnel-md5sum "e70f001ee190105c5a10a74f4bd54901">
10 <!ENTITY stunnel-size "600 KB">
11 <!ENTITY stunnel-buildsize "7.3 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 such as POP-2, POP-3, and IMAP servers, along with standalone daemons such
38 as NNTP, SMTP, and HTTP. <application>stunnel</application> can also be
39 used to tunnel PPP over network sockets without changes to the server
40 package source code.</para>
41
42 &lfs77_checked; &gcc5_checked;
43
44 <bridgehead renderas="sect3">Package Information</bridgehead>
45 <itemizedlist spacing="compact">
46 <listitem>
47 <para>Download (HTTP): <ulink url="&stunnel-download-http;"/></para>
48 </listitem>
49 <listitem>
50 <para>Download (FTP): <ulink url="&stunnel-download-ftp;"/></para>
51 </listitem>
52 <listitem>
53 <para>Download MD5 sum: &stunnel-md5sum;</para>
54 </listitem>
55 <listitem>
56 <para>Download size: &stunnel-size;</para>
57 </listitem>
58 <listitem>
59 <para>Estimated disk space required: &stunnel-buildsize;</para>
60 </listitem>
61 <listitem>
62 <para>Estimated build time: &stunnel-time;</para>
63 </listitem>
64 </itemizedlist>
65
66 <bridgehead renderas="sect3">stunnel Dependencies</bridgehead>
67
68 <bridgehead renderas="sect4">Required</bridgehead>
69 <para role="required">
70 <xref linkend="openssl"/>
71 </para>
72
73 <bridgehead renderas="sect4">Optional</bridgehead>
74 <para role="optional">
75 <ulink url="ftp://ftp.porcupine.org/pub/security/">tcpwrappers</ulink> and
76 <ulink url="https://dist.torproject.org/">TOR</ulink>
77 </para>
78
79 <para condition="html" role="usernotes">User Notes:
80 <ulink url="&blfs-wiki;/stunnel"/></para>
81
82 </sect2>
83
84 <sect2 role="installation">
85 <title>Installation of stunnel</title>
86
87 <para>The <command>stunnel</command> daemon will be run in a
88 <command>chroot</command> jail by an unprivileged user. Create the
89 new user and group using the following commands as the
90 <systemitem class="username">root</systemitem> user:</para>
91
92<screen role="root"><userinput>groupadd -g 51 stunnel &amp;&amp;
93useradd -c "stunnel Daemon" -d /var/lib/stunnel \
94 -g stunnel -s /bin/false -u 51 stunnel</userinput></screen>
95
96 <note>
97 <para>A signed SSL Certificate and a Private Key is necessary to run the
98 <command>stunnel</command> daemon. After the package is installed, there
99 are instructions to generate them. However, if you own or have already
100 created a signed SSL 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>Install <application>stunnel</application> by running the following
118 commands:</para>
119
120 <note>
121 <para>For some systems with <application>binutils</application>
122 versions prior to 2.25, <command>configure</command> may fail. If
123 necessary, fix it either with:</para>
124
125<screen><userinput>sed -i '/LDFLAGS.*static_flag/ s/^/#/' configure</userinput></screen>
126
127 <para>or, if <xref linkend="llvm"/> with Clang is installed, you can
128 replace <command>./configure ...</command> with <command>CC=clang
129 ./configure ...</command> in the first command below.</para>
130 </note>
131
132<screen><userinput>./configure --prefix=/usr \
133 --sysconfdir=/etc \
134 --localstatedir=/var \
135 --disable-systemd &amp;&amp;
136make</userinput></screen>
137
138 <para>This package does not come with a test suite.</para>
139
140 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
141
142<screen role="root"><userinput>make docdir=/usr/share/doc/stunnel-&stunnel-version; install</userinput></screen>
143
144 <para>If you do not already have a signed SSL Certificate and Private Key,
145 create the <filename>stunnel.pem</filename> file in the
146 <filename class="directory">/etc/stunnel</filename> directory using the
147 command below. You will be prompted to enter the necessary
148 information. Ensure you reply to the</para>
149
150<screen><prompt>Common Name (FQDN of your server) [localhost]:</prompt></screen>
151
152 <para>prompt with the name or IP address you will be using
153 to access the service(s).</para>
154
155 <para>To generate a certificate, as the
156 <systemitem class="username">root</systemitem> user, issue:</para>
157
158<screen role="root"><userinput>make cert</userinput></screen>
159
160 </sect2>
161
162 <sect2 role="commands">
163 <title>Command Explanations</title>
164
165 <para><parameter>--disable-systemd</parameter>: This switch disables
166 systemd socket activation support which is not available in BLFS.</para>
167
168 <para><command>make docdir=... install</command>: This command installs the
169 package and changes the documentation installation directory to standard
170 naming conventions.</para>
171
172 </sect2>
173
174 <sect2 role="configuration">
175 <title>Configuring stunnel</title>
176
177 <sect3 id="stunnel-config">
178 <title>Config Files</title>
179
180 <para><filename>/etc/stunnel/stunnel.conf</filename></para>
181
182 <indexterm zone="stunnel stunnel-config">
183 <primary sortas="e-etc-stunnel-stunnel.conf">/etc/stunnel/stunnel.conf</primary>
184 </indexterm>
185
186 </sect3>
187
188 <sect3>
189 <title>Configuration Information</title>
190
191 <para>As the <systemitem class="username">root</systemitem> user,
192 create the directory used for the
193 <filename class="extension">.pid</filename> file created
194 when the <application>stunnel</application> daemon starts:</para>
195
196<screen role="root"><userinput>install -v -m750 -o stunnel -g stunnel -d /var/lib/stunnel/run &amp;&amp;
197chown stunnel:stunnel /var/lib/stunnel</userinput></screen>
198
199 <para>Next, create a basic <filename>/etc/stunnel/stunnel.conf</filename>
200 configuration file using the following commands as the
201 <systemitem class="username">root</systemitem> user:</para>
202
203<screen role="root"><userinput>cat &gt;/etc/stunnel/stunnel.conf &lt;&lt; "EOF" &amp;&amp;
204<literal>; File: /etc/stunnel/stunnel.conf
205
206; Note: The pid and output locations are relative to the chroot location.
207
208pid = /run/stunnel.pid
209chroot = /var/lib/stunnel
210client = no
211setuid = stunnel
212setgid = stunnel
213cert = /etc/stunnel/stunnel.pem
214
215;debug = 7
216;output = stunnel.log
217
218;[https]
219;accept = 443
220;connect = 80
221;; "TIMEOUTclose = 0" is a workaround for a design flaw in Microsoft SSL
222;; Microsoft implementations do not use SSL close-notify alert and thus
223;; they are vulnerable to truncation attacks
224;TIMEOUTclose = 0</literal>
225
226EOF
227chmod -v 644 /etc/stunnel/stunnel.conf</userinput></screen>
228
229 <para>Finally, add the service(s) you wish to encrypt to the
230 configuration file. The format is as follows:</para>
231
232<screen><literal>[<replaceable>&lt;service&gt;</replaceable>]
233accept = <replaceable>&lt;hostname:portnumber&gt;</replaceable>
234connect = <replaceable>&lt;hostname:portnumber&gt;</replaceable></literal></screen>
235
236 <para>If you use <application>stunnel</application> to encrypt a daemon
237 started from <command>[x]inetd</command>, you may need to disable that
238 daemon in the <filename>/etc/[x]inetd.conf</filename> file and enable a
239 corresponding <replaceable>&lt;service&gt;</replaceable>_stunnel service. You
240 may have to add an appropriate entry in <filename>/etc/services</filename>
241 as well.</para>
242
243 <para>For a full explanation of the commands and syntax used in the
244 configuration file, issue <command>man stunnel</command>.</para>
245
246 </sect3>
247
248 <sect3 id="stunnel-init">
249 <title>Boot Script</title>
250
251 <para>To automatically start the <command>stunnel</command> daemon
252 when the system is booted, install the
253 <filename>/etc/rc.d/init.d/stunnel</filename> bootscript from the
254 <xref linkend="bootscripts"/> package.</para>
255
256 <indexterm zone="stunnel stunnel-init">
257 <primary sortas="f-stunnel">stunnel</primary>
258 </indexterm>
259
260<screen role="root"><userinput>make install-stunnel</userinput></screen>
261
262 </sect3>
263
264 </sect2>
265
266 <sect2 role="content">
267 <title>Contents</title>
268
269 <segmentedlist>
270 <segtitle>Installed Programs</segtitle>
271 <segtitle>Installed Library</segtitle>
272 <segtitle>Installed Directories</segtitle>
273
274 <seglistitem>
275 <seg>stunnel and stunnel3</seg>
276 <seg>libstunnel.so</seg>
277 <seg>/etc/stunnel,
278 /usr/lib/stunnel,
279 /usr/share/doc/stunnel-&stunnel-version;, and
280 /var/lib/stunnel</seg>
281 </seglistitem>
282 </segmentedlist>
283
284 <variablelist>
285 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
286 <?dbfo list-presentation="list"?>
287 <?dbhtml list-presentation="table"?>
288
289 <varlistentry id="stunnel-prog">
290 <term><command>stunnel</command></term>
291 <listitem>
292 <para> is a program designed to work as an SSL
293 encryption wrapper between remote clients and local
294 (<command>{x}inetd</command>-startable) or remote servers.</para>
295 <indexterm zone="stunnel stunnel-prog">
296 <primary sortas="b-stunnel">stunnel</primary>
297 </indexterm>
298 </listitem>
299 </varlistentry>
300
301 <varlistentry id="stunnel3">
302 <term><command>stunnel3</command></term>
303 <listitem>
304 <para>is a <application>Perl</application> wrapper script to use
305 <command>stunnel</command> 3.x syntax with <command>stunnel</command>
306 >=4.05.</para>
307 <indexterm zone="stunnel stunnel3">
308 <primary sortas="b-stunnel3">stunnel3</primary>
309 </indexterm>
310 </listitem>
311 </varlistentry>
312
313 <varlistentry id="libstunnel">
314 <term><filename class='libraryfile'>libstunnel.so</filename></term>
315 <listitem>
316 <para> contains the API functions required by
317 <application>stunnel</application>.</para>
318 <indexterm zone="stunnel libstunnel">
319 <primary sortas="c-libstunnel">libstunnel.so</primary>
320 </indexterm>
321 </listitem>
322 </varlistentry>
323
324 </variablelist>
325
326 </sect2>
327
328</sect1>
Note: See TracBrowser for help on using the repository browser.