<div dir="ltr">Hi there. I have a program I have used successfully with Stunnel for many years.<div><br></div><div>A while back, I discovered that my program, which is a pure stdio console program, stopped working with 5.x versions of Stunnel. I have spent many hours but have been unable to solve the problem, so I regretfully continue to use the 4.x branch. I was wondering if anyone had similar experiences? Relevant data is pasted below. I comment in the log output where the problem occurs.</div><div><br></div><div>Any help at all would be greatly appreciated.</div><div><br></div><div>stunnel.conf:</div><div><div>setuid = stunnel</div><div>setgid = stunnel</div><div>pid = /var/run/stunnel/stunnel.pid</div><div>socket = l:TCP_NODELAY=1<br></div><div>socket = r:TCP_NODELAY=1<br></div><div>foreground = no<br></div><div>debug = 7<br></div><div>output = /var/log/stunnel.log</div><div><br></div><div>[CF2]</div><div>client = no</div><div>accept = 21</div><div>verify = 3</div><div>sslVersion = all</div><div>cert = /etc/stunnel/demo.pem</div><div>key = /etc/stunnel/demo.pem</div><div>CApath = /etc/stunnel/certs</div><div>CRLpath = /etc/stunnel/crls</div><div>TIMEOUTbusy = 60</div><div>TIMEOUTclose = 0</div><div>TIMEOUTconnect = 60</div><div>TIMEOUTidle = 60</div><div><br></div><div>exec = /opt/cmf/bin/cf-server</div><div>execargs = /opt/cmf/bin/cf-server -p /opt/jail/stunnel/pipes/</div><div><br></div></div><div>Log of successful session with 4.54:</div><div><div>2015.05.01 15:39:39 LOG7[3080:140402563495680]: Starting certificate verification: depth=0, /C=US/L=Bryan/ST=TX/O=Demo Account/emailAddress=<a href="http://demo@demo.com/CN=demo">demo@demo.com/CN=demo</a></div><div>2015.05.01 15:39:39 LOG6[3080:140402563495680]: CERT: Locally installed certificate matched</div><div>2015.05.01 15:39:39 LOG5[3080:140402563495680]: Certificate accepted: depth=0, /C=US/L=Bryan/ST=TX/O=Demo Account/emailAddress=<a href="http://demo@demo.com/CN=demo">demo@demo.com/CN=demo</a></div><div>2015.05.01 15:39:39 LOG7[3080:140402563495680]: SSL state (accept): SSLv3 read client certificate A</div><div>2015.05.01 15:39:39 LOG7[3080:140402563495680]: SSL state (accept): SSLv3 read client key exchange A</div><div>2015.05.01 15:39:39 LOG7[3080:140402563495680]: SSL state (accept): SSLv3 read certificate verify A</div><div>2015.05.01 15:39:39 LOG7[3080:140402563495680]: SSL state (accept): SSLv3 read finished A</div><div>2015.05.01 15:39:39 LOG7[3080:140402563495680]: SSL state (accept): SSLv3 write session ticket A</div><div>2015.05.01 15:39:39 LOG7[3080:140402563495680]: SSL state (accept): SSLv3 write change cipher spec A</div><div>2015.05.01 15:39:39 LOG7[3080:140402563495680]: SSL state (accept): SSLv3 write finished A</div><div>2015.05.01 15:39:39 LOG7[3080:140402563495680]: SSL state (accept): SSLv3 flush data</div><div>2015.05.01 15:39:39 LOG7[3080:140402563495680]:    0 items in the session cache</div><div>2015.05.01 15:39:39 LOG7[3080:140402563495680]:    0 client connects (SSL_connect())</div><div>2015.05.01 15:39:39 LOG7[3080:140402563495680]:    0 client connects that finished</div><div>2015.05.01 15:39:39 LOG7[3080:140402563495680]:    0 client renegotiations requested</div><div>2015.05.01 15:39:39 LOG7[3080:140402563495680]:    1 server connects (SSL_accept())</div><div>2015.05.01 15:39:39 LOG7[3080:140402563495680]:    1 server connects that finished</div><div>2015.05.01 15:39:39 LOG7[3080:140402563495680]:    0 server renegotiations requested</div><div>2015.05.01 15:39:39 LOG7[3080:140402563495680]:    0 session cache hits</div><div>2015.05.01 15:39:39 LOG7[3080:140402563495680]:    0 external session cache hits</div><div>2015.05.01 15:39:39 LOG7[3080:140402563495680]:    0 session cache misses</div><div>2015.05.01 15:39:39 LOG7[3080:140402563495680]:    0 session cache timeouts</div><div>2015.05.01 15:39:39 LOG6[3080:140402563495680]: SSL accepted: new session negotiated</div><div>2015.05.01 15:39:39 LOG6[3080:140402563495680]: Negotiated TLSv1/SSLv3 ciphersuite: ECDHE-RSA-AES256-GCM-SHA384 (256-bit encryption)</div><div>2015.05.01 15:39:39 LOG6[3080:140402563495680]: Compression: null, expansion: null</div><div>2015.05.01 15:39:39 LOG6[3080:140402563495680]: Local mode child started (PID=3118)</div><div>2015.05.01 15:39:39 LOG7[3080:140402563495680]: Remote socket (FD=11) initialized</div><div>*** the connection is established and stable; i explicitly disconnect several seconds later</div><div>2015.05.01 15:39:45 LOG7[3080:140402563495680]: SSL socket closed on SSL_read</div><div>2015.05.01 15:39:45 LOG7[3080:140402563495680]: Sent socket write shutdown</div><div>2015.05.01 15:39:45 LOG5[3080:140402563495680]: Connection closed: 0 byte(s) sent to SSL, 0 byte(s) sent to socket</div><div>2015.05.01 15:39:45 LOG7[3080:140402563495680]: Remote socket (FD=11) closed</div><div>2015.05.01 15:39:45 LOG7[3080:140402563495680]: Local socket (FD=3) closed</div><div>2015.05.01 15:39:45 LOG7[3080:140402563495680]: Service [CF2] finished (0 left)</div></div><div><br></div><div><div>Log of unsuccessful session with 5.16:</div></div><div><div>2015.05.01 15:37:33 LOG7[0]: Verification started at depth=0: C=US, L=Bryan, ST=TX, O=Demo Account, emailAddress=<a href="mailto:demo@demo.com">demo@demo.com</a>, CN=demo</div><div>2015.05.01 15:37:33 LOG7[0]: CERT: Pre-verification succeeded</div><div>2015.05.01 15:37:33 LOG6[0]: CERT: Locally installed certificate matched</div><div>2015.05.01 15:37:33 LOG5[0]: Certificate accepted at depth=0: C=US, L=Bryan, ST=TX, O=Demo Account, emailAddress=<a href="mailto:demo@demo.com">demo@demo.com</a>, CN=demo</div><div>2015.05.01 15:37:33 LOG7[0]: SSL state (accept): SSLv3 read client certificate A</div><div>2015.05.01 15:37:33 LOG7[0]: SSL state (accept): SSLv3 read client key exchange A</div><div>2015.05.01 15:37:33 LOG7[0]: SSL state (accept): SSLv3 read certificate verify A</div><div>2015.05.01 15:37:33 LOG7[0]: SSL state (accept): SSLv3 read finished A</div><div>2015.05.01 15:37:33 LOG7[0]: SSL state (accept): SSLv3 write change cipher spec A</div><div>2015.05.01 15:37:33 LOG7[0]: SSL state (accept): SSLv3 write finished A</div><div>2015.05.01 15:37:33 LOG7[0]: SSL state (accept): SSLv3 flush data</div><div>2015.05.01 15:37:33 LOG7[0]:    1 server accept(s) requested</div><div>2015.05.01 15:37:33 LOG7[0]:    1 server accept(s) succeeded</div><div>2015.05.01 15:37:33 LOG7[0]:    0 server renegotiation(s) requested</div><div>2015.05.01 15:37:33 LOG7[0]:    0 session reuse(s)</div><div>2015.05.01 15:37:33 LOG7[0]:    0 internal session cache item(s)</div><div>2015.05.01 15:37:33 LOG7[0]:    0 internal session cache fill-up(s)</div><div>2015.05.01 15:37:33 LOG7[0]:    0 internal session cache miss(es)</div><div>2015.05.01 15:37:33 LOG7[0]:    0 external session cache hit(s)</div><div>2015.05.01 15:37:33 LOG7[0]:    0 expired session(s) retrieved</div><div>2015.05.01 15:37:33 LOG6[0]: SSL accepted: new session negotiated</div><div>2015.05.01 15:37:33 LOG7[0]: Peer certificate was cached (1610 bytes)</div><div>2015.05.01 15:37:33 LOG6[0]: Negotiated TLSv1.2 ciphersuite ECDHE-RSA-AES256-GCM-SHA384 (256-bit encryption)</div><div>2015.05.01 15:37:33 LOG7[0]: Compression: null, expansion: null</div><div>2015.05.01 15:37:33 LOG6[0]: Local mode child started (PID=2899)</div><div>2015.05.01 15:37:33 LOG7[0]: Remote socket (FD=11) initialized</div><div>*** immediately after successful connection, something happens; my program has no log output either, which seems to indicate that stunnel is closing it</div><div>2015.05.01 15:37:33 LOG6[0]: Read socket closed (readsocket)</div><div>2015.05.01 15:37:33 LOG7[main]: Dispatching signals from the signal pipe</div><div>2015.05.01 15:37:33 LOG7[0]: Sending close_notify alert</div><div>2015.05.01 15:37:33 LOG7[main]: Processing SIGCHLD</div><div>2015.05.01 15:37:33 LOG7[0]: SSL alert (write): warning: close notify</div><div>2015.05.01 15:37:33 LOG6[main]: Child process 2899 terminated on signal 11</div><div>2015.05.01 15:37:33 LOG6[0]: SSL_shutdown successfully sent close_notify alert</div><div>2015.05.01 15:37:33 LOG7[main]: Signal pipe is empty</div><div>2015.05.01 15:37:33 LOG3[0]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing</div><div>2015.05.01 15:37:33 LOG5[0]: Connection closed: 0 byte(s) sent to SSL, 0 byte(s) sent to socket</div><div>2015.05.01 15:37:33 LOG7[0]: Remote socket (FD=11) closed</div><div>2015.05.01 15:37:33 LOG7[0]: Local socket (FD=3) closed</div><div>2015.05.01 15:37:33 LOG7[0]: Service [CF2] finished (0 left)</div></div><div><br></div></div>