title: Weird behavior/error trying to use HAProxy to forward requests to ELBs
body: <p>We have an architecture where have several APIs on multiple hosts. Each API sits behind an AWS ELB. We want to put a proxy in front that will route requests based on URI to the ELB.</p>
  
  <p>What I have so far mostly works, but about 3 out of 10 requests result in the following error (using cURL, but the problem isn't cURL):</p>
  
  <pre><code>curl: (35) Unknown SSL protocol error in connection to test-router.versal.com:-9847
  </code></pre>
  
  <p>I have a feeling that the ELB is the culprit. The SSL is terminated there.</p>
  
  <p>Here is our HAProxy config:</p>
  
  <pre><code>global
    log 127.0.0.1   local0
    log 127.0.0.1   local1 notice
    maxconn 10240
    user haproxy
    group haproxy
    daemon
    debug
    stats socket /var/run/haproxy.sock
    log-send-hostname test-router.domain.com
    description "HAProxy on test-router.domain.com"
  
  defaults
    log     global
    mode    http
    option  httplog
    option  dontlognull
    retries 3
    option redispatch
    option forwardfor
    option httpclose
    option dontlognull
    option tcpka
    maxconn 10240
    timeout connect 10000ms
    timeout client 600000ms
    timeout server 600000ms
  
  frontend public
    bind *:80
    bind *:443
    acl elb0 path_beg /elb0
    acl elb1 path_beg /elb1
    use_backend elb0 if elb0
    use_backend elb1 if elb1
  
    bind 0.0.0.0:443 ssl crt /etc/ssl/cert.pem no-sslv3 ciphers AES128+EECDH:AES128+EDH
  
  backend elb0
    server server_vcat elb0.domain.com:443 ssl verify none
  
  backend elb1
    server server_laapi elb1.domain.com:443 ssl verify none
  </code></pre>