It finaly works!!! Even with SSL it works great.
The clue was to chance the config of stunnel to work correct (Update using SSL now):
; Certificate/key is needed in server mode and optional in client mode cert = /path/to/<myCert>.pem key = /path/to/<myKey>.key ; Protocol version (all, SSLv2, SSLv3, TLSv1) sslVersion = all ; Some security enhancements for UNIX systems - comment them out on Win32 chroot = /var/run/stunnel/ ; PID is created inside the chroot jail pid = /stunnel.pid ; Some performance tunings socket = l:TCP_NODELAY=1 socket = r:TCP_NODELAY=1 ;compression = zlib ; Some debugging stuff useful for troubleshooting debug = 7 output = /var/log/stunnel/stunnel.log ;foreground = yes ; Use it for client mode ;client = yes !! turn to server mode ; Service-level configuration [wsServer] accept = 0.0.0.0:9030 !! listen to all addresses connect = 127.0.0.1:9090
Note: marks with !! are no valid comments! I inserted them only to show the changes.