<div class="gmail_quote">Hello!<div><br></div><div>I have a game client connecting to a server using TCP over SSL.</div><div>I'm trying to setup an SSL proxy using 2 stunnels on the same server like so:</div><div>
<br></div><div>Client --> Stunnel-Server:20001 (decrypt)--> Stunnel-Client:901  (encrypt)---> Server:20001</div><div><br></div><div>Using latest stunnel-4.21-r1 on Gentoo kernel 2.6.22-gentoo-r9</div>
<div><br></div><div>I have a weird problem.</div><div>The first connection after starting both stunnels works fine.</div><div>Afterwards every time the client tries to connect, it gets refused once. Then it tries again and gets connected.</div>

<div>Then the next time it will once again get refused once and then connect.</div><div><br></div><div>I have looked at the logs and it seems the Stunnel server (the first) gets Connection Refused from localhost:901.</div>

<div>Then it tries again and gets connected.</div><div>The Stunnel client (the second) doesn't even mention the first failing local connection in the log.</div><div><br></div><div>I have provided the config files of both stunnels and a log with debug = 7 (server ip's are censored)</div>

<div><br></div><div>I have also tried the following config tweaks with no luck</div><div><br></div><div><div>socket = l:TCP_NODELAY=1</div><div>socket = r:TCP_NODELAY=1</div>
<div>TIMEOUTclose = 0</div><div>retry = yes</div><div><br></div><div>Any help would be appreciated.</div><div>Thanks!!</div></div><font color="#888888"><div><br></div><div><br>-- <br>
Avner Peled.
</div><div><a href="mailto:avnerus@gmail.com" target="_blank">avnerus@gmail.com</a></div><div><br></div></font></div>