Team,<div><br></div><div>I am configuring stunnel for the first time.</div><div>My Requirement:     "NetApp DataFabricManager" application on SLES10 SP4 platform  <------  (LDAP over Stunnel) -----> Windows 2003 Active Directory, for Active Directory user authentication.</div>
<div><br></div><div><br></div><div>Stunnel.conf:</div><div>-----------------------------------------------------------</div><div><div>setuid = root</div><div>setgid = root</div><div><br></div><div>client = yes</div><div><br>
</div><div>debug = 7</div><div>output = /root/stunnel.log</div><div><br></div><div>cert = /opt/crt_key.pem</div><div>key = /opt/crt_key.pem</div><div><br></div><div>pid = /var/run/stunnel.pid</div><div><br></div><div>verify = 3</div>
<div>CAfile = /opt/crt_key.pem</div><div><br></div><div>options = NO_SSLv2</div><div><br></div><div>[ldap]</div><div>accept = 389</div><div>connect = winad1-197-187:636</div><div><br></div><div>[ldap-ha]</div><div>accept = 8389</div>
<div>connect = winad2-197-189:636</div></div><div>-----------------------------------------------------------</div><div><br></div><div><div>ocm5-197-196:~ # dfm ldap list</div><div>Address                                    Port   Last Use                   Last Failure</div>
<div>------------------------------------------ ------ -------------------------- --------------------------</div><div>127.0.0.1                                  389    2013-01-02 14:01:52.000000</div><div>127.0.0.1                                  8389   2013-01-02 13:49:35.000000</div>
<div>ocm5-197-196:~ #</div></div><div><br></div><div><br></div><div><div>ocm5-197-196:~ # dfm ldap find user1</div><div>Warning: Failed to bind to ldap server '127.0.0.1' as user 'CN=Administrator,CN=Users,DC=<zz>,DC=<xx>,DC=<yy>,DC=com': Can't contact LDAP server</div>
<div>Error: Failed to search for user1.</div><div>ocm5-197-196:~ #</div></div><div><br></div><div>NOTE: If i add active directory server IP in the above list, instead of 127.0.0.1, ldap authentication works fine. </div><div>
<br></div><div><div>ocm5-197-196:~ # cat /etc/services</div></div><div>...</div><div>.....</div><div>........</div><div><div>#### This is a Manual Entry made by root user for AD authentication services & Stunnel Integration ########</div>
<div>ldap-ha         8389/tcp    # 2nd LDAP host for DC redundancy [Redirected to 2nd DC by Stunnel, see /etc/stunnel/stunnel.conf]</div><div>ldap-ha         8389/udp    # 2nd LDAP host for DC redundancy [Redirected to 2nd DC by Stunnel, see /etc/stunnel/stunnel.conf]</div>
</div><div><br></div><div><br></div><div>ocm5-197-196:~ # stunnel /root/stunnel-4.54/tools/stunnel.conf</div><div><br></div><div><br></div><div>stunnel.log:</div><div><br></div><div><div>2013.01.02 14:00:42 LOG7[7102:47010476379680]: Clients allowed=500</div>
<div>2013.01.02 14:00:42 LOG5[7102:47010476379680]: stunnel 4.54 on x86_64-unknown-linux-gnu platform</div><div>2013.01.02 14:00:42 LOG5[7102:47010476379680]: Compiled/running with OpenSSL 0.9.8a 11 Oct 2005</div><div>2013.01.02 14:00:42 LOG5[7102:47010476379680]: Threading:PTHREAD SSL:+ENGINE Auth:none Sockets:POLL+IPv6</div>
<div>2013.01.02 14:00:42 LOG5[7102:47010476379680]: Reading configuration from file /root/stunnel-4.54/tools/stunnel.conf</div><div>2013.01.02 14:00:42 LOG7[7102:47010476379680]: Compression not enabled</div><div>2013.01.02 14:00:42 LOG7[7102:47010476379680]: Snagged 64 random bytes from /root/.rnd</div>
<div>2013.01.02 14:00:42 LOG7[7102:47010476379680]: Wrote 1024 new random bytes to /root/.rnd</div><div>2013.01.02 14:00:42 LOG7[7102:47010476379680]: PRNG seeded successfully</div><div>2013.01.02 14:00:42 LOG6[7102:47010476379680]: Initializing service [ldap]</div>
<div>2013.01.02 14:00:42 LOG7[7102:47010476379680]: Certificate: /opt/crt_key.pem</div><div>2013.01.02 14:00:42 LOG7[7102:47010476379680]: Certificate loaded</div><div>2013.01.02 14:00:42 LOG7[7102:47010476379680]: Key file: /opt/crt_key.pem</div>
<div>2013.01.02 14:00:42 LOG7[7102:47010476379680]: Private key loaded</div><div>2013.01.02 14:00:42 LOG7[7102:47010476379680]: Loaded verify certificates from /opt/crt_key.pem</div><div>2013.01.02 14:00:42 LOG7[7102:47010476379680]: Loaded /opt/crt_key.pem revocation lookup file</div>
<div>2013.01.02 14:00:42 LOG7[7102:47010476379680]: SSL options set: 0x01000004</div><div>2013.01.02 14:00:42 LOG6[7102:47010476379680]: Initializing service [ldap-ha]</div><div>2013.01.02 14:00:42 LOG7[7102:47010476379680]: Certificate: /opt/crt_key.pem</div>
<div>2013.01.02 14:00:42 LOG7[7102:47010476379680]: Certificate loaded</div><div>2013.01.02 14:00:42 LOG7[7102:47010476379680]: Key file: /opt/crt_key.pem</div><div>2013.01.02 14:00:42 LOG7[7102:47010476379680]: Private key loaded</div>
<div>2013.01.02 14:00:42 LOG7[7102:47010476379680]: Loaded verify certificates from /opt/crt_key.pem</div><div>2013.01.02 14:00:42 LOG7[7102:47010476379680]: Loaded /opt/crt_key.pem revocation lookup file</div><div>2013.01.02 14:00:42 LOG7[7102:47010476379680]: SSL options set: 0x01000004</div>
<div>2013.01.02 14:00:42 LOG5[7102:47010476379680]: Configuration successful</div><div>2013.01.02 14:00:42 LOG7[7102:47010476379680]: Service [ldap] (FD=7) bound to <a href="http://0.0.0.0:389">0.0.0.0:389</a></div><div>2013.01.02 14:00:42 LOG7[7102:47010476379680]: Service [ldap-ha] (FD=8) bound to <a href="http://0.0.0.0:8389">0.0.0.0:8389</a></div>
<div>2013.01.02 14:00:42 LOG7[7103:47010476379680]: Created pid file /var/run/stunnel.pid</div><div>2013.01.02 14:01:52 LOG7[7103:47010476379680]: Service [ldap] accepted (FD=3) from <a href="http://127.0.0.1:60332">127.0.0.1:60332</a></div>
<div>2013.01.02 14:01:52 LOG7[7103:1073809728]: Service [ldap] started</div><div>2013.01.02 14:01:52 LOG5[7103:1073809728]: Service [ldap] accepted connection from <a href="http://127.0.0.1:60332">127.0.0.1:60332</a></div>
<div>2013.01.02 14:01:52 LOG6[7103:1073809728]: connect_blocking: connecting <a href="http://192.168.10.7:636">192.168.10.7:636</a></div><div>2013.01.02 14:01:52 LOG7[7103:1073809728]: connect_blocking: s_poll_wait <a href="http://192.168.10.7:636">192.168.10.7:636</a>: waiting 10 seconds</div>
<div>2013.01.02 14:01:52 LOG5[7103:1073809728]: connect_blocking: connected <a href="http://192.168.10.7:636">192.168.10.7:636</a></div><div>2013.01.02 14:01:52 LOG5[7103:1073809728]: Service [ldap] connected remote server from <a href="http://192.168.10.1:40664">192.168.10.1:40664</a></div>
<div>2013.01.02 14:01:52 LOG7[7103:1073809728]: Remote socket (FD=10) initialized</div><div>2013.01.02 14:01:52 LOG7[7103:1073809728]: SSL state (connect): before/connect initialization</div><div>2013.01.02 14:01:52 LOG7[7103:1073809728]: SSL state (connect): SSLv3 write client hello A</div>
<div>2013.01.02 14:01:52 LOG3[7103:1073809728]: SSL_connect: Peer suddenly disconnected                                              <------------------</div><div>2013.01.02 14:01:52 LOG5[7103:1073809728]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket</div>
<div>2013.01.02 14:01:52 LOG7[7103:1073809728]: Remote socket (FD=10) closed</div><div>2013.01.02 14:01:52 LOG7[7103:1073809728]: Local socket (FD=3) closed</div><div>2013.01.02 14:01:52 LOG7[7103:1073809728]: Service [ldap] finished (0 left)</div>
</div><div><br></div><div><br></div><div>I initially started with stunnel-4.14 available with SLES10 GA OS media. Noticed peer disconnected issue.</div><div>I went through the stunnel mailing list archive for related issues, but didn't get much help.</div>
<div>Finally upgraded stunnel to v4.54 & to no progress.</div><div><br></div><div>google hits mentioned that its configuration issue / client is not accepting sockets..  but finally no clue how to proceed.</div><div><br>
</div><div>Kindly assist "SSL_connect: Peer suddenly disconnected"  & SSL handshake work.</div><div><br></div><div>Warm Regards,</div><div>Arun </div><div>UNIX admin</div><div><br></div><div><br></div><div><br>
</div>