title: Two-way TLS/HTTPS passthrough via HAProxy
body: <p>Any suggestions for setting up a proxy between two parties that are doing a two-way TLS connection? </p>
  
  <p>Concept:</p>
  
  <pre><code>[Client (dynamic IP)] ==&gt; [Proxy (static IP)] ==&gt; [Server]
  [                   ] ====== two-way TLS =======&gt; [      ]
  </code></pre>
  
  <p>The server has proxy's IP address whitelisted.</p>
  
  <p>The proxy only acts as a static IP point in the chain and will not be able to decrypt the data. It is only supposed to forward TCP packets between parties.</p>
  
  <p>My hunch is that HAProxy's tcp mode needs to be leveraged somehow, but I keep missing something.</p>
  
  <pre><code>frontend tcp_proxy
      bind *:9000
      mode tcp
      option tcplog
      default_backend tcp_proxy_app
  
  backend tcp_proxy_app
      balance roundrobin
      mode tcp
      option ssl-hello-chk
      option tcp-check
      server app1 &lt;server-address&gt;:9100 check
  </code></pre>