<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7651.59">
<TITLE>2 secure sockets TCP (Server / Client) as posted earlier last month by khaled</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Arial">Hi,</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">I'm having the same question (and problem) as posted by khaled on Mon Jan 7 19:31:03 CET 2008, subject [stunnel-users] 2 secure sockets TCP (Server / Client).</FONT></P>
<P><FONT SIZE=2 FACE="Arial">I think I have to send data to stunnel on the client side by a write to localhost:1974 where stunnel is configured with this stunnel.conf:</FONT></P>
<P><FONT SIZE=2 FACE="Arial">; Sample stunnel configuration file by Michal Trojnara 2002-2006</FONT>
<BR><FONT SIZE=2 FACE="Arial">; Some options used here may not be adequate for your particular configuration</FONT>
<BR><FONT SIZE=2 FACE="Arial">; Certificate/key is needed in server mode and optional in client mode</FONT>
<BR><FONT SIZE=2 FACE="Arial">; The default certificate is provided only for testing and should not</FONT>
<BR><FONT SIZE=2 FACE="Arial">; be used in a production environment</FONT>
<BR><FONT SIZE=2 FACE="Arial">cert = stunnel.pem</FONT>
<BR><FONT SIZE=2 FACE="Arial">;key = stunnel.pem</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">; Some performance tunings</FONT>
<BR><FONT SIZE=2 FACE="Arial">socket = l:TCP_NODELAY=1</FONT>
<BR><FONT SIZE=2 FACE="Arial">socket = r:TCP_NODELAY=1</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">; Use it for client mode</FONT>
<BR><FONT SIZE=2 FACE="Arial">;client = yes</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">; Service-level configuration</FONT>
<BR><FONT SIZE=2 FACE="Arial">[sip2s]</FONT>
<BR><FONT SIZE=2 FACE="Arial">accept = 1975</FONT>
<BR><FONT SIZE=2 FACE="Arial">connect = 127.0.0.1:1974</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">To start stunnel only works with just stunnel.</FONT>
<BR><FONT SIZE=2 FACE="Arial">Started from batch or in dos-box with the options -d -r etc. as explained in the documentation does not work, error message: file not found)</FONT></P>
<P><FONT SIZE=2 FACE="Arial">BTW: I'm using Windows XP Professional on both client and server. Client IP = 10.4.208.159, server IP = 10.4.208.102 for a test set-up.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">On the server side it gives the same error when started with options.</FONT>
<BR><FONT SIZE=2 FACE="Arial">stunnel.conf on the server is this:</FONT>
<BR><FONT SIZE=2 FACE="Arial">; Sample stunnel configuration file by Michal Trojnara 2002-2006</FONT>
<BR><FONT SIZE=2 FACE="Arial">; Some options used here may not be adequate for your particular configuration</FONT>
<BR><FONT SIZE=2 FACE="Arial">; Certificate/key is needed in server mode and optional in client mode</FONT>
<BR><FONT SIZE=2 FACE="Arial">; The default certificate is provided only for testing and should not be used in a production environment</FONT>
<BR><FONT SIZE=2 FACE="Arial">cert = stunnel.pem</FONT>
<BR><FONT SIZE=2 FACE="Arial">;key = stunnel.pem</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">; Some performance tunings</FONT>
<BR><FONT SIZE=2 FACE="Arial">socket = l:TCP_NODELAY=1</FONT>
<BR><FONT SIZE=2 FACE="Arial">socket = r:TCP_NODELAY=1</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">; Some debugging stuff useful for troubleshooting</FONT>
<BR><FONT SIZE=2 FACE="Arial">debug = 7</FONT>
<BR><FONT SIZE=2 FACE="Arial">output = stunnel.log</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">; Use it for client mode</FONT>
<BR><FONT SIZE=2 FACE="Arial">client = yes</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">; Service-level configuration</FONT>
<BR><FONT SIZE=2 FACE="Arial">[sip2s]</FONT>
<BR><FONT SIZE=2 FACE="Arial">accept = 1975</FONT>
<BR><FONT SIZE=2 FACE="Arial">connect = 127.0.0.1:1974</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Reading data on TCP/IP 1974 does not display anything when the client is sending data to localhost:1974 which is encrypted by stunnel an forwarded on TCP/IP 1975.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">At least that is my intention, but something I do is wrong.</FONT>
<BR><FONT SIZE=2 FACE="Arial">Data sending unencrypted between client an server works fine, so connection is possible.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Any idea what I should do to let it work like this:</FONT>
<BR><FONT SIZE=2 FACE="Arial">- a client sends data to a server and reads the response from this server.</FONT>
<BR><FONT SIZE=2 FACE="Arial">- all data on the network between client an server should be encrypted.</FONT>
<BR><FONT SIZE=2 FACE="Arial">As far as I could find in the stunnel manual it should be able to use stunnel for this.</FONT>
<BR><FONT SIZE=2 FACE="Arial">In the manual is an example using foo (client) and bar (server).</FONT>
</P>
<P><SPAN LANG="nl"><FONT COLOR="#000000" SIZE=2 FACE="Arial">Dick van Fulpen | Senior Software Engineer |</FONT><FONT COLOR="#808080" SIZE=2 FACE="Arial"></FONT><B> <FONT COLOR="#800000" SIZE=2 FACE="Arial">Infor</FONT></B><FONT COLOR="#000000" SIZE=2 FACE="Arial"> | Tel:+31 (0)73 6205 222 |</FONT></SPAN><SPAN LANG="fr"><FONT COLOR="#808080" SIZE=2 FACE="Arial"> </FONT></SPAN><A HREF="mailto:Dick.vanFulpen@infor.com"><SPAN LANG="fr"><U><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">Dick.vanFulpen@infor.com</FONT></U></SPAN></A><SPAN LANG="fr"></SPAN><SPAN LANG="nl"><FONT COLOR="#000000" SIZE=2 FACE="Arial"> | Infor | Postbus 2067 | 5202 CB 's-Hertogenbosch | Nederland | Bezoek onze website</FONT> </SPAN><A HREF="file://www.vubis-smart.com"><SPAN LANG="nl"><U></U><U><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">www.vubis-smart.com</FONT></U></SPAN></A><SPAN LANG="nl"></SPAN><SPAN LANG="en-us"><FONT COLOR="#000000" SIZE=2 FACE="Arial"> |</FONT></SPAN></P>
</BODY>
</HTML>