| | 1 | = Http Proxy with tls = |
| | 2 | |
| | 3 | |
| | 4 | == TinyProxy == |
| | 5 | https://tinyproxy.github.io/ |
| | 6 | |
| | 7 | {{{ |
| | 8 | ## Configuration |
| | 9 | ## /etc/tinyproxy/tinyproxy.conf or /etc/tinyproxy.conf |
| | 10 | |
| | 11 | /etc/init.d/tinyproxy restart |
| | 12 | |
| | 13 | }}} |
| | 14 | |
| | 15 | |
| | 16 | == Stunnel == |
| | 17 | https://www.stunnel.org/ |
| | 18 | |
| | 19 | {{{ |
| | 20 | ## Server Configuration |
| | 21 | ## /etc/stunnel/stunnel.conf |
| | 22 | |
| | 23 | cert = /etc/stunnel/stunnel.pem |
| | 24 | sslVersion = TLSv1 |
| | 25 | |
| | 26 | chroot = /var/run/stunnel/ |
| | 27 | setuid = nobody |
| | 28 | setgid = nobody |
| | 29 | pid = /stunnel.pid |
| | 30 | |
| | 31 | socket = l:TCP_NODELAY=1 |
| | 32 | socket = r:TCP_NODELAY=1 |
| | 33 | compression = zlib |
| | 34 | |
| | 35 | [tinyproxy] |
| | 36 | accept = 443 |
| | 37 | connect = 127.0.0.1:8888 |
| | 38 | |
| | 39 | }}} |
| | 40 | |
| | 41 | {{{ |
| | 42 | ## For Server ## |
| | 43 | ## Create Certificate |
| | 44 | |
| | 45 | openssl genrsa -out /etc/stunnel/key.pem 2048 |
| | 46 | openssl req -new -x509 -key /etc/stunnel/key.pem -out /etc/stunnel/cert.pem -days 7300 |
| | 47 | |
| | 48 | cat /etc/stunnel/{key.pem,cert.pem} >/etc/stunnel/stunnel.pem |
| | 49 | mkdir /var/run/stunnel && chown nobody. /var/run/stunnel |
| | 50 | |
| | 51 | ## Launch |
| | 52 | stunnel /etc/stunnel/stunnel.conf |
| | 53 | |
| | 54 | }}} |
| | 55 | |
| | 56 | {{{ |
| | 57 | ## Client Configuration |
| | 58 | ## /etc/stunnel/stunnel.conf |
| | 59 | |
| | 60 | cert = /etc/stunnel/stunnel.pem |
| | 61 | sslVersion = TLSv1 |
| | 62 | |
| | 63 | chroot = /var/run/stunnel/ |
| | 64 | setuid = nobody |
| | 65 | setgid = nobody |
| | 66 | pid = /stunnel.pid |
| | 67 | |
| | 68 | socket = l:TCP_NODELAY=1 |
| | 69 | socket = r:TCP_NODELAY=1 |
| | 70 | compression = zlib |
| | 71 | |
| | 72 | client = yes |
| | 73 | |
| | 74 | [tinyproxy] |
| | 75 | accept = 9999 |
| | 76 | connect = $SERVER_IP:443 |
| | 77 | |
| | 78 | }}} |
| | 79 | |
| | 80 | {{{ |
| | 81 | ## For Client ## |
| | 82 | ## Get stunnel.pem from server |
| | 83 | |
| | 84 | stunnel /etc/stunnel/stunnel.conf |
| | 85 | |
| | 86 | }}} |