title: can stunnel process traffic from a proxy-protocol speaker (haproxy, amazon elb, etc)
body: <p>I'm trying to setup a stunnel ssl farm load balanced by haproxy. It kinda looks like</p>
  
  <p>haproxy -> many stunnels -> haproxy -> apache,nginx etc</p>
  
  <p>Problem is to carry the original ip over to the final servers. It seems proxy-protocol is the perfect method but I have only been able to figure out how to send it from stunnel to haproxy</p>
  
  <p>stunnel -> haproxy</p>
  
  <p>when i put haproxy in tcp mode and use send-proxy towards the stunnel server, i geet ssl error</p>
  
  <p>haproxy example:</p>
  
  <pre><code>frontend ssl_in
    bind 1.1.1.1:443
    mode tcp
    default_backend stunnel_srv
  
  backend stunnel_srv
    mode tcp
    server 1.1.1.2:443 check send-proxy
  </code></pre>
  
  <p>stunnel config:</p>
  
  <pre><code>[https]
  cert = /etc/stunnel/certs/test.examaple.org/fullchain.cer
  key = /etc/stunnel/certs/test.example.org/private.key
  accept = 1.1.1.2:443
  connect = 1.1.1.3:8085
  protocol = proxy
  TIMEOUTclose = 0
  </code></pre>
  
  <p>Seems stunnel doesn't want to receive proxy-protocol headers and can only send them. any ideas of a magical option to achieve that?</p>
  
  <p>Cheers</p>