[stunnel-users] How do I do a one-time client connection?

D. Richard Hipp drh at hwaci.com
Tue Jan 13 17:27:40 CET 2009

On Jan 13, 2009, at 11:07 AM, Karl J. Runge wrote:

> On Tue, 13 Jan 2009, "D. Richard Hipp" <drh at hwaci.com> wrote:
>> I'm sure I could get something like that to work on Unix.
>> Unfortunately, I need a cross-platform solution:; unix & windows.   
>> And
>> (as usual) the windows side is harder to work around.
>> What I really need to do is send a known amount of binary data in a
>> file over an SSL connection to a remote machine, then get back the
>> reply of unknown length into a separate file:
>>     stunnel test.conf <test.in >test.out
>> I'm open to any suggestions on how to do this, (such that it will  
>> work
>> on unix and windows).
> So it is not an https URL like in your example?  If it were, perhaps
> wget or curl for windows would be a better path than stunnel.

I'm using a simple web-page fetch for debugging.  In actual use, the  
situation is more complicated and wget and curl won't work.  Thx for  
the suggestion, though.

> socat might be ported to windows, I'm not sure.  If writing a small C
> wrapper program for Windows is not acceptable, I'm not sure what you
> can do.

socat appears to be linux-mostly.  (They have a MacOS-X port, which  
suggests that it is not even "unix" neutral.)  So I'm guessing that  
windows is out of the question there.

Looks like I'm just going to have to bite the bullet and link against  
OpenSSL directly.....

> BTW, I have made a one-time connection patch to stunnel that I use  
> with
> my VNC tool SSVNC:
>    http://libvncserver.cvs.sourceforge.net/viewvc/libvncserver/libvncserver/x11vnc/misc/enhanced_tightvnc_viewer/src/patches/stunnel-maxconn.patch?revision=1.2&view=markup
> It is a hack, but useful.  My VNC tool works OK with stock stunnel
> (everything else equal I prefer using), but I also distribute a  
> patched
> stunnel for more reliable behavior in this one-time client connect  
> mode.
> Karl

D. Richard Hipp
drh at hwaci.com

More information about the stunnel-users mailing list