In the latest versions of stunnel including stunnel-4.54b8,
activating the option for transparent destination with
transparent=destination fails.
The following error is found in the log with this configuration
(tested on CentOS 6.2 and 6.3):
INTERNAL ERROR: No target for remote socket
This bug seems to be introduced with version 4.51 by rewriting
the code and introducing additional sanity checks for the
configuration.
The following patch seems to resolve the problem:
--- src/client.c.~1~ 2012-03-05 12:11:06.000000000 +0100
+++ src/client.c 2012-08-27 00:29:36.000000000 +0200
@@ -303,7 +303,7 @@
c->bind_addr=NULL; /* don't bind */
/* setup c->remote_fd, now */
- if(c->opt->option.remote) { /* try remote first for
exec+connect targets */
+ if(c->opt->option.remote ||
c->opt->option.transparent_dst) { /* try remote first for
exec+connect targets */
c->remote_fd.fd=connect_remote(c);
} else if(c->opt->option.program) { /* exec+connect
uses local fd */
c->remote_fd.fd=connect_local(c);