[stunnel-users] [PATCH] Address already in use (98) when binding to localhost

Christian Kujau lists at nerdbynature.de
Thu Feb 8 12:31:47 CET 2018


On Wed, 7 Feb 2018, MichaƂ Trojnara wrote:
> https://www.stunnel.org/downloads/beta/stunnel-5.45b1.tar.gz
> It should fix your scenario without changing the default hostname for 
> "accept".

Hm. So, this version still gives the same error, but instead of exiting, 
it appears to start:

=================================
$ stunnel-5.45b1 ./stunnel.test
2018.02.08 03:00:57 LOG5[ui]: stunnel 5.45 on x86_64-pc-linux-gnu platform
2018.02.08 03:00:57 LOG5[ui]: Compiled/running with OpenSSL 1.1.0g-fips  2 Nov 2017
2018.02.08 03:00:57 LOG5[ui]: Threading:PTHREAD Sockets:POLL,IPv6 TLS:ENGINE,FIPS,OCSP,PSK,SNI Auth:LIBWRAP
2018.02.08 03:00:57 LOG5[ui]: Reading configuration from file /home/christian/stunnel.test
2018.02.08 03:00:57 LOG5[ui]: UTF-8 byte order mark not detected
2018.02.08 03:00:57 LOG5[ui]: FIPS mode disabled
2018.02.08 03:00:57 LOG4[ui]: Service [test] needs authentication to prevent MITM attacks
2018.02.08 03:00:57 LOG5[ui]: Configuration successful
2018.02.08 03:00:57 LOG3[ui]: bind: Address already in use (98)
2018.02.08 03:00:57 LOG3[ui]: Error binding service [test] to 127.0.0.1:12345
=================================

But even with the error, it's still running (in forground) it is able to 
bind to the port, but answers only to the IPv4 version of it:

=================================
$ netstat -an | grep :12345
tcp        0      0 127.0.0.1:12345         0.0.0.0:*               LISTEN

$ nc -w1 -6vz localhost 12345
Ncat: Version 7.60 ( https://nmap.org/ncat )
Ncat: Connection refused.
=================================

And both 019_localhost and 020_IPv6 succeed, because both tests appear to 
connect via 127.0.0.1 again:


$ grep -n 127 tests/test_library 
92:          printf "%-35s\t%s\n" "test $1" "$2" | "$3" 127.0.0.1 "$http1" -vv 2>> "stderr_nc.log"
94:          printf "%-35s\t%s\n" "test $1" "$2" | "$3" 127.0.0.1 "$http1" -vv 2>> "stderr_nc.log" &
122:  waiting_for "stunnel" "127.0.0.1:${http1}" "UNUSED PATTERN" "UNUSED PATTERN"
192:      cat "nodata" | "$2" 127.0.0.1 "$http1" -vv > "temp.log" 2>>"stderr.log" &


> > I see "Version 5.45" already mention in the changelog on the website,
> > but now download yet?
> 
> Wasn't it marked as "unreleased"?

Ah, yes - makes sense :-)

Thanks,
Christian.

PS: Btw, is there a source code repository setup for stunnel, besides the 
    HTTP/Rsync mirrors?
-- 
BOFH excuse #188:

..disk or the processor is on fire.



More information about the stunnel-users mailing list