[stunnel-users] Connection refused, then connects

James Brown jlbrown at bordo.com.au
Fri May 17 15:06:26 CEST 2019



> On 17 May 2019, at 5:07 pm, Peter Pentchev <roam at ringlet.net> wrote:
> 
> On Fri, May 17, 2019 at 01:54:47PM +1000, James Brown wrote:
>> Can anyone tell me why It tries ::1:25 first and fails before connecting to 127.0.0.1:25?
>> 
>> 2019.05.17 13:48:34 LOG5[21]: Service [ssmtp465] accepted connection from ::ffff:192.168.1.76:49170
>> 2019.05.17 13:48:34 LOG3[21]: s_connect: connect ::1:25: Connection refused (61)
>> 2019.05.17 13:48:34 LOG5[21]: s_connect: connected 127.0.0.1:25
>> 2019.05.17 13:48:34 LOG5[21]: Service [ssmtp465] connected remote server from 127.0.0.1:56701
>> 
>> /usr/local/etc/stunnel/stunnel.conf has:
>> 
>> [ssmtp465]
>> client = no
>> accept  = 465
>> connect = 25
>> options = NO_SSLv2
>> #transparent = source
> 
> You have specified only a port number, not an address; thus, stunnel assumes
> the local host address. You have not explicitly told it to only use IPv4
> addresses, so it tries the IPv6 local host address (::1) first; when that
> fails, it falls back to the IPv4 local host address (127.0.0.1).
> 
> If you change the line to "connect = 127.0.0.1:25" like for your other
> service, it will go straight to the IPv4 local host address.
> 
> Hope that helps!
> 
> G'luck,
> Peter

Perfect, that worked - Thanks Peter

(Obvious now that I think of it!)

James.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 4688 bytes
Desc: not available
URL: <http://www.stunnel.org/pipermail/stunnel-users/attachments/20190517/fb758cda/attachment.bin>


More information about the stunnel-users mailing list