<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>Jack,<br/><br/>No need to apologize. There are no stupid questions... but those are the easiest to solve ;-)<br/><br/>It is not a waste of time if we all learn something, and I still don't know what you are doing with this combination of stunnel and 3proxy. So please, enlighten me. It could be useful for any of us. Thanks.<br/><br/>Jose<hr/><div><b>From: </b> Jack Liu <jackliu92@hotmail.com>
</div><div><b>Date: </b>Tue, 26 Apr 2011 23:59:59 -0600</div><div><b>To: </b><josealf@rocketmail.com>; <stunnel-users@stunnel.org></div><div><b>Subject: </b>RE: [stunnel-users] Stunnel stuck at SSL state (accept):
 before/accept initialization</div><div><br/></div>
Thank you for replying...<BR>
I just solved all my problem out 5 minutes ago, since I was busy today, or else I would solve this earlier.<BR>
 <BR>
The problem was cause by misconfiguration/misunderstanding between client and server.<BR>
Then, I was sending my request to the server directly instead of sending it to 127.0.0.1:xxxx (Stunnel client)<BR>
 <BR>
Now I figured everything out, and I am sorry for taking your time for a stupid question like this.<BR>
Thanks again for everyone who have helped me and have a great day!<BR> <BR>

<HR id=stopSpelling>
Date: Tue, 26 Apr 2011 21:02:31 -0700<BR>From: josealf@rocketmail.com<BR>Subject: Re: [stunnel-users] Stunnel stuck at SSL state (accept): before/accept initialization<BR>To: jackliu92@hotmail.com<BR>CC: stunnel-users@stunnel.org<BR><BR>
<META name=Generator content="Microsoft SafeHTML">
<STYLE>
.ExternalClass DIV
{;}

</STYLE>

<DIV style="FONT-FAMILY: bookman old style, new york, times, serif; FONT-SIZE: 12pt">
<DIV>Jack,</DIV>
<DIV> </DIV>
<DIV>Looks like you're getting closer... but I don't know where you're going :-)</DIV>
<DIV> </DIV>
<DIV>I want to understand better your problem. So please help me:</DIV>
<DIV> </DIV>
<DIV>1. Exactly what are you trying to acomplish? So far, I see that your stunnel is configured as a client to your 3proxy server. </DIV>
<DIV>2. What does the 3proxy server do? What's behind it? Does it works as a SSL server? The error you see suggests it is not speaking SSLV3.<BR></DIV>
<DIV>Best regards</DIV>
<DIV>Jose</DIV>
<DIV style="FONT-FAMILY: bookman old style, new york, times, serif; FONT-SIZE: 12pt"><BR>
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt"><FONT size=2 face=Tahoma>
<HR SIZE=1>
<B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Jack Liu <jackliu92@hotmail.com><BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> Jack Liu <jackliu92@hotmail.com>; stunnel-users@stunnel.org<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Tue, April 26, 2011 12:01:16 PM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [stunnel-users] Stunnel stuck at SSL state (accept): before/accept initialization<BR></FONT><BR>
<STYLE>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Tahoma;}

</STYLE>
After adding<BR>client = yes into cfg, problem fixed, howerver, new problem created:<BR> <BR>2011.04.26 10:47:29 LOG5[27745:3086699408]: Service 3proxy accepted connection from xx.xxx.xxx.xx:2017<BR>2011.04.26 10:47:29 LOG7[27745:3086699408]: remote socket: FD=13 allocated (non-blocking mode)<BR>2011.04.26 10:47:29 LOG6[27745:3086699408]: connect_blocking: connecting 127.0.0.1:30010<BR>2011.04.26 10:47:29 LOG7[27745:3086699408]: connect_blocking: s_poll_wait 127.0.0.1:30010: waiting 10 seconds<BR>2011.04.26 10:47:29 LOG5[27745:3086699408]: connect_blocking: connected 127.0.0.1:30010<BR>2011.04.26 10:47:29 LOG5[27745:3086699408]: Service 3proxy connected remote server from 127.0.0.1:59959<BR>2011.04.26 10:47:29 LOG7[27745:3086699408]: Remote FD=13 initialized<BR>2011.04.26 10:47:29 LOG7[27745:3086699408]: Option TCP_NODELAY set on remote socket<BR>2011.04.26 10:47:29 LOG7[27745:3086699408]: SSL state (connect): before/connect initialization<BR>2011.04.26 10:47:29 LOG7[27745:3086699408]: SSL state (connect): SSLv3 write client hello A<BR>2011.04.26 10:47:29 LOG7[27745:3086699408]: SSL alert (write): fatal: handshake failure<BR>2011.04.26 10:47:29 LOG3[27745:3086699408]: SSL_connect: 1408F10B: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number<BR>2011.04.26 10:47:29 LOG5[27745:3086699408]: Connection reset: 0 bytes sent to SSL, 0 bytes sent to socket<BR>2011.04.26 10:47:29 LOG7[27745:3086699408]: Service 3proxy finished (0 left)<BR>2011.04.26 10:52:53 LOG7[27745:3086702288]: Dispatching signals from the signal pipe<BR>2011.04.26 10:52:53 LOG6[27745:3086702288]: Child process 27746 terminated on signal 2<BR>2011.04.26 10:52:53 LOG3[27745:3086702288]: Received signal 2; terminating<BR>2011.04.26 10:52:53 LOG7[27745:3086702288]: removing pid file /var/run/stunnel.pid<BR><BR>Anyone have any suggestion how to fix:<BR>2011.04.26 10:47:29 LOG7[27745:3086699408]: SSL alert (write): fatal: handshake failure<BR>2011.04.26 10:47:29 LOG3[27745:3086699408]: SSL_connect: 1408F10B: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number<BR> <BR>Thank you!<BR><BR>Mr. Jack<BR> <BR><BR><BR><BR> <BR>
<HR id=ecxstopSpelling>
From: jackliu92@hotmail.com<BR>To: sunyucong@gmail.com; stunnel-users@stunnel.org<BR>Date: Mon, 25 Apr 2011 21:26:58 -0600<BR>Subject: Re: [stunnel-users] Stunnel stuck at SSL state (accept): before/accept initialization<BR><BR>
<STYLE>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Tahoma;}
</STYLE>
Thx for continuing reply my msg, Yes, there is var/log/messages<BR><BR>Inside there only has some iptables log, FTP, SMTP application log and nothing else.<BR>I am positive that this problem is not cause by iptables, becuase I tried with iptables off.<BR> <BR>Nothing else related to stunnel is found in that folder.<BR> <BR>Any other suggestions?<BR><BR>Mr. Jack<BR> <BR>> From: sunyucong@gmail.com<BR>> Date: Mon, 25 Apr 2011 20:00:30 -0700<BR>> Subject: Re: [stunnel-users] Stunnel stuck at SSL state (accept): before/accept initialization<BR>> To: jackliu92@hotmail.com<BR>> CC: stunnel-users@stunnel.org<BR>> <BR>> I guess in centos that's /var/log/messages<BR>> but in general, you should probably check everything in /var/log to make sure.<BR>> <BR>> On Mon, Apr 25, 2011 at 5:38 PM, Jack Liu <jackliu92@hotmail.com> wrote:<BR>> > Thank you for helping, but both logs r not presented in my var/log/ dir. Any<BR>> > other suggestions?<BR>> ><BR>> ><BR>> > Mr. Jack<BR>> ><BR>> ><BR>> ><BR>> ><BR>> ><BR>> >> From: sunyucong@gmail.com<BR>> >> Date: Mon, 25 Apr 2011 16:25:20 -0700<BR>> >> Subject: Re: [stunnel-users] Stunnel stuck at SSL state (accept):<BR>> >> before/accept initialization<BR>> >> To: jackliu92@hotmail.com<BR>> >> CC: stunnel-users@stunnel.org<BR>> >><BR>> >> Are you sure that's entire log? check /var/log/daemons.log and<BR>> >> syslog.log as well.<BR>> >><BR>> >> On Sun, Apr 24, 2011 at 1:30 AM, Jack Liu <jackliu92@hotmail.com> wrote:<BR>> >> > It anyone knows how to fix Stunnel stuck at SSL state (accept):<BR>> >> > before/accept initialization???<BR>> >> ><BR>> >> > Here is the log:<BR>> >> ><BR>> >> > -----------------------------------------------------------------------------------------------------------<BR>> >> > [root@vps1 ~]#stunnel /etc/stunnel/stunnel.conf<BR>> >> > 2011.04.24 02:25:13 LOG7[32174:3085993680]: Snagged 64 random bytes from<BR>> >> > /root/.rnd<BR>> >> > 2011.04.24 02:25:13 LOG7[32174:3085993680]: Wrote 1024 new random bytes<BR>> >> > to<BR>> >> > /root/.rnd<BR>> >> > 2011.04.24 02:25:13 LOG7[32174:3085993680]: RAND_status claims<BR>> >> > sufficient<BR>> >> > entropy for the PRNG<BR>> >> > 2011.04.24 02:25:13 LOG6[32174:3085993680]: PRNG seeded successfully<BR>> >> > 2011.04.24 02:25:13 LOG7[32174:3085993680]: Certificate:<BR>> >> > /etc/stunnel/stunnel.pem<BR>> >> > 2011.04.24 02:25:13 LOG7[32174:3085993680]: Key file:<BR>> >> > /etc/stunnel/stunnel.pem<BR>> >> > 2011.04.24 02:25:13 LOG7[32174:3085993680]: Verify directory set to<BR>> >> > /etc/stunnel/CA<BR>> >> > 2011.04.24 02:25:13 LOG7[32174:3085993680]: CRL directory set to<BR>> >> > /etc/stunnel/CRL<BR>> >> > 2011.04.24 02:25:13 LOG7[32174:3085993680]: SSL context initialized for<BR>> >> > service 3proxy<BR>> >> > 2011.04.24 02:25:13 LOG5[32174:3085993680]: stunnel 4.15 on<BR>> >> > i686-redhat-linux-gnu with OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008<BR>> >> > 2011.04.24 02:25:13 LOG5[32174:3085993680]: Threading:PTHREAD SSL:ENGINE<BR>> >> > Sockets:POLL,IPv6 Auth:LIBWRAP<BR>> >> > 2011.04.24 02:25:13 LOG6[32174:3085993680]: file ulimit = 1024 (can be<BR>> >> > changed with 'ulimit -n')<BR>> >> > 2011.04.24 02:25:13 LOG6[32174:3085993680]: poll() used - no FD_SETSIZE<BR>> >> > limit for file descriptors<BR>> >> > 2011.04.24 02:25:13 LOG5[32174:3085993680]: 500 clients allowed<BR>> >> > 2011.04.24 02:25:13 LOG7[32174:3085993680]: FD 3 in non-blocking mode<BR>> >> > 2011.04.24 02:25:13 LOG7[32174:3085993680]: FD 4 in non-blocking mode<BR>> >> > 2011.04.24 02:25:13 LOG7[32174:3085993680]: FD 5 in non-blocking mode<BR>> >> > 2011.04.24 02:25:13 LOG7[32174:3085993680]: SO_REUSEADDR option set on<BR>> >> > accept socket<BR>> >> > 2011.04.24 02:25:13 LOG7[32174:3085993680]: 3proxy bound to<BR>> >> > 0.0.0.0:30001<BR>> >> > 2011.04.24 02:25:13 LOG7[32174:3085993680]: Created pid file<BR>> >> > /var/run/stunnel.pid<BR>> >> > 2011.04.24 02:25:20 LOG7[32174:3085993680]: 3proxy accepted FD=6 from<BR>> >> > xx.xxx.xxx.xx:41165<BR>> >> > 2011.04.24 02:25:20 LOG7[32174:3085990800]: 3proxy started<BR>> >> > 2011.04.24 02:25:20 LOG7[32174:3085990800]: FD 6 in non-blocking mode<BR>> >> > 2011.04.24 02:25:20 LOG7[32174:3085990800]: FD 7 in non-blocking mode<BR>> >> > 2011.04.24 02:25:20 LOG7[32174:3085990800]: FD 8 in non-blocking mode<BR>> >> > 2011.04.24 02:25:20 LOG7[32174:3085993680]: Cleaning up the signal pipe<BR>> >> > 2011.04.24 02:25:20 LOG6[32174:3085993680]: Child process 32176 finished<BR>> >> > with code 0<BR>> >> > 2011.04.24 02:25:20 LOG7[32174:3085990800]: Connection from<BR>> >> > xx.xxx.xxx.xx:41165 permitted by libwrap<BR>> >> > 2011.04.24 02:25:20 LOG5[32174:3085990800]: 3proxy connected from<BR>> >> > xx.xxx.xxx.xx:41165<BR>> >> > 2011.04.24 02:25:20 LOG7[32174:3085990800]: SSL state (accept):<BR>> >> > before/accept initialization          <-----------------------Stuck here<BR>> >> > forever!!!<BR>> >> > 2011.04.24 02:25:22 LOG3[32174:3085990800]: SSL_accept: Peer suddenly<BR>> >> > disconnected<BR>> >> > 2011.04.24 02:25:22 LOG5[32174:3085990800]: Connection reset: 0 bytes<BR>> >> > sent<BR>> >> > to SSL, 0 bytes sent to socket<BR>> >> > 2011.04.24 02:25:22 LOG7[32174:3085990800]: 3proxy finished (0 left)<BR>> >> > 2011.04.24 02:25:25 LOG3[32174:3085993680]: Received signal 2;<BR>> >> > terminating<BR>> >> > 2011.04.24 02:25:25 LOG7[32174:3085993680]: removing pid file<BR>> >> > /var/run/stunnel.pid<BR>> >> > [root@vps1 ~]#<BR>> >> ><BR>> >> > -----------------------------------------------------------------------------------------------------------<BR>> >> > stunnel.conf:<BR>> >> > cert = /etc/stunnel/stunnel.pem<BR>> >> > key = /etc/stunnel/stunnel.pem<BR>> >> > CApath = /etc/stunnel/CA<BR>> >> > CRLpath =  /etc/stunnel/CRL<BR>> >> > debug = 7<BR>> >> > foreground = yes<BR>> >> > verify = 1<BR>> >> > #<BR>> >> > [3proxy]<BR>> >> > accept = 30001<BR>> >> > connect = 127.0.0.1:33135<BR>> >> ><BR>> >> > -----------------------------------------------------------------------------------------------------------<BR>> >> ><BR>> >> > I am hosting with CentOS 5.5, and installed Stunnel via yum.<BR>> >> > Planning to use it with 3Proxy. However I experience the problem above,<BR>> >> > can<BR>> >> > someone please help with that?<BR>> >> > Thank you very much!<BR>> >> ><BR>> >> ><BR>> >> ><BR>> >> > Mr. Jack<BR>> >> ><BR>> >> >_______________________________________________<BR>> >> > stunnel-users mailing list<BR>> >> > stunnel-users@stunnel.org<BR>> >> > http://stunnel.mirt.net/mailman/listinfo/stunnel-users<BR>> >> ><BR>> >> ><BR>> ><BR><BR>_______________________________________________ stunnel-users mailing list stunnel-users@stunnel.org http://stunnel.mirt.net/mailman/listinfo/stunnel-users </DIV></DIV></DIV>                                       </body>
</html>