Stunnel writes to stdin instead of stdout, which has the effect that it is not possible to redirect its output. Example: stunnel -c -r server > file would not write to the file. Instead of reading from stdin and writing to stdout, stunnel both reads and writes from/to stdin. The attached patch lets stunnel write to stdout if it reads from stdin. It's not very elegant, but works for me. [ Webmaster Note: The reason that stunnel worked this way is because it was meant to be invoked as a daemon or from inetd, and wasn't geared to handle this form of I/O. In inetd you *must* have the input and output be the same file descriptor because it is a bidirectional socket. ]