source: postlfs/security/stunnel.xml@ d0c42be

11.3 12.0 12.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18 xry111/xf86-video-removal
Last change on this file since d0c42be was fad9b8d, checked in by Bruce Dubbs <bdubbs@…>, 17 months ago

Update to stunnel-5.68.

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