<div dir="ltr"><div><div><div>Hello,<br><br></div>Is it possible to use stunnel server as a transparent proxy? I was digging through the manpage and I see the <br><br>transparent=<br><br></div>option. What I would like to do is have an stunnel client connect to the stunnel server, and once traffic is at the server, go to the original destination that the traffic going to the stunnel client was destined for.<br><br>I.E. Can I have firefox proxy to my stunnel client, which connects to my stunnel server, and then that traffic goes to whatever website the end user was trying to hit in firefox?<br><br><br></div><div>My Stunnel server is on a CentOS box:<br><br>[root@CentOSTunTest ~]# uname -a<br>Linux CentOSTunTest 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux<br><br></div><div>And my stunnel.conf <br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><div style="margin-left:40px">foreground = yes<br>debug = 7<br>options = NO_SSLv2<br>fips = no<br>output=/usr/local/etc/stunnel/stunnel.log<br><br><br>[https]<br>cert=/usr/local/etc/stunnel/stunnel.pem<br>accept = 443<br>connect = 80<br><br>[Internet]<br>cert=/usr/local/etc/stunnel/stunnel.pem<br>sni = https:Internet<br>transparent=destination<br></div></blockquote><br><br></div><div>So basically in the transparent option is Internet is what I am wondering if it works the way I expect. I see this in the log file:<br><br>2014.10.23 09:57:05 LOG3[11414]: setsockopt SO_ORIGINAL_DST: Protocol not available (92)<br>2014.10.23 09:57:05 LOG5[11414]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket<br><br></div><div>I see this in the stunnel manpage:<br><br><blockquote><p>For a connect target installed on the same host:</p>
<pre> /sbin/iptables -t nat -I OUTPUT -p tcp --dport <redirected_port> \
-m ! --uid-owner <stunnel_user_id> \
-j DNAT --to-destination <local_ip>:<stunnel_port></pre>
<p>For a connect target installed on a remote host:</p>
</blockquote><blockquote> /sbin/iptables -I INPUT -i eth0 -p tcp --dport <stunnel_port> -j ACCEPT
/sbin/iptables -t nat -I PREROUTING -p tcp --dport <redirected_port> \
-i eth0 -j DNAT --to-destination <local_ip>:<stunnel_port><br></blockquote><pre><br></pre><pre>What does it mean "for a connect target installed on the same host" <br>I thought transparent meant I was not using a connect target except the original destination. Does this mean I should implement the IPTables for a remote host, since I want my client to just reach the internet?<br><br><br>Thanks for the help in advance!<br></pre><pre><br></pre><br></div><div><br><br><br></div></div>