source: postlfs/security/stunnel.xml@ 6e7b9fd

12.0 12.1 ken/TL2024 ken/tuningfonts lazarus plabs/newcss python3.11 rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18
Last change on this file since 6e7b9fd was 50d8a863, checked in by Bruce Dubbs <bdubbs@…>, 12 months ago

Update to stunnel-5.70.

  • Property mode set to 100644
File size: 13.3 KB
RevLine 
[2a7d6c3e]1<?xml version="1.0" encoding="ISO-8859-1"?>
[6732c094]2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
[2a7d6c3e]4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
[43aa464d]7 <!ENTITY stunnel-download-http " ">
[49ee8357]8 <!-- Following ftp also has older releases -->
9 <!ENTITY stunnel-download-ftp "ftp://ftp.stunnel.org/stunnel/archive/5.x/stunnel-&stunnel-version;.tar.gz">
10 <!-- Following ftp only has later release -->
[a8f943ff]11<!-- "ftp://ftp.stunnel.org/stunnel/stunnel-&stunnel-version;.tar.gz"> -->
[50d8a863]12 <!ENTITY stunnel-md5sum "4246f65d556b9ec51e94f80744ce0eda">
13 <!ENTITY stunnel-size "864 KB">
[2d63a2ea]14 <!ENTITY stunnel-buildsize "6.9 MB">
[4e3dc383]15 <!ENTITY stunnel-time "less than 0.1 SBU">
[2a7d6c3e]16]>
17
[436c2f7e]18<sect1 id="stunnel" xreflabel="stunnel-&stunnel-version;">
[d3469f0]19 <?dbhtml filename="stunnel.html"?>
20
21
[436c2f7e]22 <title>stunnel-&stunnel-version;</title>
[d3469f0]23
24 <indexterm zone="stunnel">
[436c2f7e]25 <primary sortas="a-stunnel">stunnel</primary>
[d3469f0]26 </indexterm>
27
28 <sect2 role="package">
[436c2f7e]29 <title>Introduction to stunnel</title>
[d3469f0]30
[47274444]31 <para>
32 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
[6b8f495]35 channels. <!--<application>stunnel</application> can be used to add SSL
[47274444]36 functionality to commonly used <application>Inetd</application> daemons
37 such as POP-2, POP-3, and IMAP servers, along with standalone daemons
[6b8f495]38 such as NNTP, SMTP, and HTTP.--> <application>stunnel</application> can
[47274444]39 also be used to tunnel PPP over network sockets without changes to the
40 server package source code.
41 </para>
[d3469f0]42
[cfd4fa8]43 &lfs113_checked;
[ee792ef]44
[d3469f0]45 <bridgehead renderas="sect3">Package Information</bridgehead>
46 <itemizedlist spacing="compact">
47 <listitem>
[47274444]48 <para>
49 Download (HTTP): <ulink url="&stunnel-download-http;"/>
50 </para>
[d3469f0]51 </listitem>
52 <listitem>
[47274444]53 <para>
54 Download (FTP): <ulink url="&stunnel-download-ftp;"/>
55 </para>
[d3469f0]56 </listitem>
57 <listitem>
[47274444]58 <para>
59 Download MD5 sum: &stunnel-md5sum;
60 </para>
[d3469f0]61 </listitem>
62 <listitem>
[47274444]63 <para>
64 Download size: &stunnel-size;
65 </para>
[d3469f0]66 </listitem>
67 <listitem>
[47274444]68 <para>
69 Estimated disk space required: &stunnel-buildsize;
70 </para>
[d3469f0]71 </listitem>
72 <listitem>
[47274444]73 <para>
74 Estimated build time: &stunnel-time;
75 </para>
[d3469f0]76 </listitem>
77 </itemizedlist>
78
[436c2f7e]79 <bridgehead renderas="sect3">stunnel Dependencies</bridgehead>
[658b42d8]80
[372898b]81 <bridgehead renderas="sect4">Optional</bridgehead>
82 <para role="optional">
[6b8f495]83 <xref linkend="libnsl"/>,
[17aa21c]84 <ulink url="https://netcat.sourceforge.net/">netcat</ulink>
[47274444]85 (required for tests),
[6b7a631]86 <ulink url="http://ftp.porcupine.org/pub/security/index.html">tcpwrappers</ulink>,
[47274444]87 and
[15e49d1]88 <ulink url="https://dist.torproject.org/">TOR</ulink>
[372898b]89 </para>
[d3469f0]90
91 </sect2>
92
93 <sect2 role="installation">
[436c2f7e]94 <title>Installation of stunnel</title>
[d3469f0]95
[47274444]96 <para>
97 The <command>stunnel</command> daemon will be run in a
98 <command>chroot</command> jail by an unprivileged user. Create the
99 new user and group using the following commands as the
100 <systemitem class="username">root</systemitem> user:
101 </para>
[d3469f0]102
[b785ab29]103<screen role="root"><userinput>groupadd -g 51 stunnel &amp;&amp;
[436c2f7e]104useradd -c "stunnel Daemon" -d /var/lib/stunnel \
[1ae11c9]105 -g stunnel -s /bin/false -u 51 stunnel</userinput></screen>
[d3469f0]106
107 <note>
[47274444]108 <para>
109 A signed SSL Certificate and a Private Key is necessary to run the
110 <command>stunnel</command> daemon. After the package is installed,
111 there are instructions to generate them. However, if you own or have
112 already created a signed SSL Certificate you wish to use, copy it to
113 <filename>/etc/stunnel/stunnel.pem</filename> before starting the
114 build (ensure only <systemitem class="username">root</systemitem> has
115 read and write access). The <filename class="extension">.pem</filename>
116 file must be formatted as shown below:
117 </para>
[d3469f0]118
[30ca77d2]119<screen><literal>-----BEGIN PRIVATE KEY-----
120<replaceable>&lt;many encrypted lines of private key&gt;</replaceable>
121-----END PRIVATE KEY-----
[2a7d6c3e]122-----BEGIN CERTIFICATE-----
[3597eb6]123<replaceable>&lt;many encrypted lines of certificate&gt;</replaceable>
[30ca77d2]124-----END CERTIFICATE-----
125-----BEGIN DH PARAMETERS-----
126<replaceable>&lt;encrypted lines of dh parms&gt;</replaceable>
127-----END DH PARAMETERS-----</literal></screen>
[47274444]128
[d3469f0]129 </note>
[2a7d6c3e]130
[47274444]131 <para>
132 Install <application>stunnel</application> by running the following
133 commands:
134 </para>
[4a496c3]135
[0f870c5]136<!-- Not needed, we're 10+ versions ahead of this now
[4efb652]137 <note>
[47274444]138 <para>
139 For some systems with <application>binutils</application>
140 versions prior to 2.25, <command>configure</command> may fail. If
141 necessary, fix it either with:
142 </para>
[4d5c31d]143
144<screen><userinput>sed -i '/LDFLAGS.*static_flag/ s/^/#/' configure</userinput></screen>
145
[47274444]146 <para>
147 or, if <xref linkend="llvm"/> with Clang is installed, you can
148 replace <command>./configure ...</command> with <command>CC=clang
149 ./configure ...</command> in the first command below.
150 </para>
[4efb652]151 </note>
[0f870c5]152-->
[d3469f0]153
[3c7bd00]154<screen revision="sysv"><userinput>./configure --prefix=/usr \
[06b565e]155 --sysconfdir=/etc \
156 --localstatedir=/var \
157 --disable-systemd &amp;&amp;
[d3469f0]158make</userinput></screen>
159
[3c7bd00]160<screen revision="systemd"><userinput>./configure --prefix=/usr \
161 --sysconfdir=/etc \
162 --localstatedir=/var &amp;&amp;
163make</userinput></screen>
164
[47274444]165 <para>
166 If you have installed the optional netcat application, the
167 regression tests can be run with <command>make check</command>.
168 </para>
[50d61ed]169
[47274444]170 <para>
171 Now, as the <systemitem class="username">root</systemitem> user:
172 </para>
[305e60de]173
[1ae11c9]174<screen role="root"><userinput>make docdir=/usr/share/doc/stunnel-&stunnel-version; install</userinput></screen>
[305e60de]175
[f586237]176 <para revision="systemd">
177 Install the included systemd unit by running the following command as the
178 <systemitem class="username">root</systemitem> user:
179 </para>
180
[6a054305]181<screen role="root" revision="systemd"><userinput>install -v -m644 tools/stunnel.service /usr/lib/systemd/system</userinput></screen>
[f586237]182
[47274444]183 <para>
184 If you do not already have a signed SSL Certificate and Private Key,
185 create the <filename>stunnel.pem</filename> file in the
186 <filename class="directory">/etc/stunnel</filename> directory using the
187 command below. You will be prompted to enter the necessary
188 information. Ensure you reply to the
189 </para>
[4efb652]190
[372898b]191<screen><prompt>Common Name (FQDN of your server) [localhost]:</prompt></screen>
192
[47274444]193 <para>
194 prompt with the name or IP address you will be using
195 to access the service(s).
196 </para>
[372898b]197
[47274444]198 <para>
199 To generate a certificate, as the
200 <systemitem class="username">root</systemitem> user, issue:
201 </para>
[372898b]202
203<screen role="root"><userinput>make cert</userinput></screen>
204
[d3469f0]205 </sect2>
[2a7d6c3e]206
[d3469f0]207 <sect2 role="commands">
208 <title>Command Explanations</title>
[2a7d6c3e]209
[47274444]210 <para revision="sysv">
211 <parameter>--disable-systemd</parameter>: This switch disables systemd
212 socket activation support which is not available in BLFS.
213 </para>
[06b565e]214
[47274444]215 <para>
216 <command>make docdir=... install</command>: This command installs the
217 package and changes the documentation installation directory to standard
218 naming conventions.
219 </para>
[2a7d6c3e]220
[d3469f0]221 </sect2>
[2a7d6c3e]222
[d3469f0]223 <sect2 role="configuration">
[436c2f7e]224 <title>Configuring stunnel</title>
[2a7d6c3e]225
[d3469f0]226 <sect3 id="stunnel-config">
227 <title>Config Files</title>
[2a7d6c3e]228
[47274444]229 <para>
230 <filename>/etc/stunnel/stunnel.conf</filename>
231 </para>
[2a7d6c3e]232
[d3469f0]233 <indexterm zone="stunnel stunnel-config">
234 <primary sortas="e-etc-stunnel-stunnel.conf">/etc/stunnel/stunnel.conf</primary>
235 </indexterm>
[2a7d6c3e]236
[d3469f0]237 </sect3>
[2a7d6c3e]238
[d3469f0]239 <sect3>
240 <title>Configuration Information</title>
241
[47274444]242 <para>
243 As the <systemitem class="username">root</systemitem> user,
244 create the directory used for the
245 <filename class="extension">.pid</filename> file created
246 when the <application>stunnel</application> daemon starts:
247 </para>
[1ae11c9]248
[8ba08b56]249<screen role="root"><userinput>install -v -m750 -o stunnel -g stunnel -d /var/lib/stunnel/run &amp;&amp;
250chown stunnel:stunnel /var/lib/stunnel</userinput></screen>
[1ae11c9]251
[47274444]252 <para>
253 Next, create a basic <filename>/etc/stunnel/stunnel.conf</filename>
254 configuration file using the following commands as the
255 <systemitem class="username">root</systemitem> user:
256 </para>
[d3469f0]257
[8558044]258<screen role="root"><userinput>cat &gt; /etc/stunnel/stunnel.conf &lt;&lt; "EOF"
[1ae11c9]259<literal>; File: /etc/stunnel/stunnel.conf
[2a7d6c3e]260
[372898b]261; Note: The pid and output locations are relative to the chroot location.
262
[1ae11c9]263pid = /run/stunnel.pid
[2a7d6c3e]264chroot = /var/lib/stunnel
265client = no
266setuid = stunnel
[30ca77d2]267setgid = stunnel
[372898b]268cert = /etc/stunnel/stunnel.pem
269
270;debug = 7
271;output = stunnel.log
272
273;[https]
274;accept = 443
275;connect = 80
276;; "TIMEOUTclose = 0" is a workaround for a design flaw in Microsoft SSL
277;; Microsoft implementations do not use SSL close-notify alert and thus
278;; they are vulnerable to truncation attacks
279;TIMEOUTclose = 0</literal>
[2a7d6c3e]280
[bfdd32ae]281EOF</userinput></screen>
[2a7d6c3e]282
[47274444]283 <para>
284 Finally, add the service(s) you wish to encrypt to the
285 configuration file. The format is as follows:
286 </para>
[2a7d6c3e]287
[3597eb6]288<screen><literal>[<replaceable>&lt;service&gt;</replaceable>]
289accept = <replaceable>&lt;hostname:portnumber&gt;</replaceable>
290connect = <replaceable>&lt;hostname:portnumber&gt;</replaceable></literal></screen>
[d3469f0]291
[6b8f495]292<!--
[47274444]293 <para>
294 If you use <application>stunnel</application> to encrypt a daemon
295 started from <command>[x]inetd</command>, you may need to disable that
296 daemon in the <filename>/etc/[x]inetd.conf</filename> file and enable a
297 corresponding <replaceable>&lt;service&gt;</replaceable>_stunnel
298 service. You may have to add an appropriate entry in
299 <filename>/etc/services</filename> as well.
300 </para>
[6b8f495]301-->
[d3469f0]302
[47274444]303 <para>
304 For a full explanation of the commands and syntax used in the
305 configuration file, issue <command>man stunnel</command>.
306 </para>
[d3469f0]307
308 </sect3>
309
310 <sect3 id="stunnel-init">
[f586237]311 <title><phrase revision="sysv">Boot Script</phrase>
312 <phrase revision="systemd">Systemd Unit</phrase></title>
[d3469f0]313
[47274444]314 <para revision="sysv">
315 To automatically start the <command>stunnel</command> daemon when the
316 system is booted, install the
317 <filename>/etc/rc.d/init.d/stunnel</filename> bootscript from the
318 <xref linkend="bootscripts"/> package.
319 </para>
[f586237]320
[47274444]321 <para revision="systemd">
322 To start the <command>stunnel</command>
323 daemon at boot, enable the previously installed
324 <application>systemd</application> unit by running the following
325 command as the <systemitem class="username">root</systemitem> user:
326 </para>
[d3469f0]327
328 <indexterm zone="stunnel stunnel-init">
329 <primary sortas="f-stunnel">stunnel</primary>
330 </indexterm>
331
[f586237]332<screen role="root" revision="sysv"><userinput>make install-stunnel</userinput></screen>
333
334<screen role="root" revision="systemd"><userinput>systemctl enable stunnel</userinput></screen>
[d3469f0]335
336 </sect3>
337
338 </sect2>
339
340 <sect2 role="content">
341 <title>Contents</title>
342
343 <segmentedlist>
344 <segtitle>Installed Programs</segtitle>
345 <segtitle>Installed Library</segtitle>
346 <segtitle>Installed Directories</segtitle>
347
348 <seglistitem>
[49ee8357]349 <seg>
350 stunnel and stunnel3
351 </seg>
352 <seg>
353 libstunnel.so
354 </seg>
355 <seg>
[6b8f495]356 /{etc,lib,var/lib}/stunnel and
[49ee8357]357 /usr/share/doc/stunnel-&stunnel-version;
358 </seg>
[d3469f0]359 </seglistitem>
360 </segmentedlist>
361
362 <variablelist>
363 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
364 <?dbfo list-presentation="list"?>
[869b15ae]365 <?dbhtml list-presentation="table"?>
[d3469f0]366
367 <varlistentry id="stunnel-prog">
368 <term><command>stunnel</command></term>
369 <listitem>
[47274444]370 <para>
371 is a program designed to work as an SSL
372 encryption wrapper between remote clients and local
[6b8f495]373 or remote servers
[47274444]374 </para>
[d3469f0]375 <indexterm zone="stunnel stunnel-prog">
376 <primary sortas="b-stunnel">stunnel</primary>
377 </indexterm>
378 </listitem>
379 </varlistentry>
380
381 <varlistentry id="stunnel3">
382 <term><command>stunnel3</command></term>
383 <listitem>
[47274444]384 <para>
385 is a <application>Perl</application> wrapper script to use
386 <command>stunnel</command> 3.x syntax with
[4c24eb0a]387 <command>stunnel</command> 4.05 or later
[47274444]388 </para>
[d3469f0]389 <indexterm zone="stunnel stunnel3">
390 <primary sortas="b-stunnel3">stunnel3</primary>
391 </indexterm>
392 </listitem>
393 </varlistentry>
394
395 <varlistentry id="libstunnel">
[4c24eb0a]396 <term><filename class="libraryfile">libstunnel.so</filename></term>
[d3469f0]397 <listitem>
[47274444]398 <para>
399 contains the API functions required by
[4c24eb0a]400 <application>stunnel</application>
[47274444]401 </para>
[d3469f0]402 <indexterm zone="stunnel libstunnel">
403 <primary sortas="c-libstunnel">libstunnel.so</primary>
404 </indexterm>
405 </listitem>
406 </varlistentry>
407
408 </variablelist>
409
410 </sect2>
[2a7d6c3e]411
412</sect1>
Note: See TracBrowser for help on using the repository browser.