Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 311345 - net-misc/stunnel-4.31 configuration file incompatibility (vs. -4.29)
Summary: net-misc/stunnel-4.31 configuration file incompatibility (vs. -4.29)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Lance Albertson (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-25 20:52 UTC by barthek
Modified: 2010-06-21 15:16 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description barthek 2010-03-25 20:52:33 UTC
Hi,
i've upgraded from stunnel-4.29 (has been working fine for a long time).
It seems that stunnel-4.31 doesnt like the configuration in which it is used in inetd configuration with 'connect' as configuration directive.

all of the sudden it spawns this error message when connected to:

Reading configuration from file /etc/stunnel/stunnel.conf
Compression enabled using zlib method
RAND_status claims sufficient entropy for the PRNG
PRNG seeded successfully
Certificate: /etc/stunnel/felix
Certificate loaded
Key file: /etc/stunnel/felix
Private key loaded
SSL context initialized for service stunnel
line 68: Each service section must define two endpoints

line 68 is the 'connect' directive in the config file

the config file reads (comments removed)

ciphers = SSLv3:!LOW:!EXP:!NULL:!aNULL
setuid = stunnel
setgid = stunnel
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
compression = zlib
chroot = /etc/stunnel/chroot
cert = /etc/stunnel/felix
debug = 5
connect = localhost:110
Comment 1 Thorsten Kampe 2010-04-28 17:28:01 UTC
Confirmed: in a new set-up, stunnel in server mode will fail:

# /etc/init.d/stunnel start
 * Starting stunnel ...
 *    error starting: /etc/stunnel/stunnel.conf                                  [ !! ]
 * ERROR: stunnel failed to start

But the stunnel process will actually start; so the next start attempt will suceed(!) with an error that the port is already in use (true because the first stunnel process listens on it)
Comment 2 Lance Albertson (RETIRED) gentoo-dev 2010-06-21 00:31:50 UTC
(In reply to comment #1)
> Confirmed: in a new set-up, stunnel in server mode will fail:
> 
> # /etc/init.d/stunnel start
>  * Starting stunnel ...
>  *    error starting: /etc/stunnel/stunnel.conf                                
>  [ !! ]
>  * ERROR: stunnel failed to start
> 
> But the stunnel process will actually start; so the next start attempt will
> suceed(!) with an error that the port is already in use (true because the first
> stunnel process listens on it)

I think this bug might be related to #308931 and the original error is just a syntax error on your part. I always have an 'accept' and 'connect' section for each service and I believe you need to do that.

Can you confirm that?
Comment 3 barthek 2010-06-21 14:53:07 UTC
are you running stunnel in inetd mode?
if so, read this excerpt from the manual:

 INETD MODE
       The most common use of stunnel is to listen on a network port and establish communication with either a new port via the connect
       option, or a new program via the exec option.  However there is a special case when you wish to have some other program accept
       incoming connections and launch stunnel, for example with inetd, xinetd, or tcpserver.

       For example, if you have the following line in inetd.conf:

           imaps stream tcp nowait root /usr/bin/stunnel stunnel /etc/stunnel/imaps.conf

       In these cases, the inetd-style program is responsible for binding a network socket (imaps above) and handing it to stunnel when a
       connection is received.  Thus you do not want stunnel to have any accept option.  All the Service Level Options should be placed in
       the global options section, and no [service_name] section will be present.  See the EXAMPLES section for example configurations.
Comment 4 barthek 2010-06-21 15:16:42 UTC
anyway, just wanted to let you know that stunnel 4.33 version which is in the portage tree seems to work with my configuration file. yay! :D