# SNI works somtimes, sometimes is broken

**URL:** https://discourse.haproxy.org/t/sni-works-somtimes-sometimes-is-broken/509
**Category:** Help!
**Created:** [July 18, 2016, 6:04pm UTC](https://discourse.haproxy.org/t/sni-works-somtimes-sometimes-is-broken/509 "2016-07-18T18:04:16Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![gosi](https://avatars.discourse-cdn.com/v4/letter/g/3d9bf3/32.png) [@gosi](https://discourse.haproxy.org/u/gosi)
#### Post date: [July 18, 2016, 6:04pm UTC](https://discourse.haproxy.org/t/sni-works-somtimes-sometimes-is-broken/509/1 "2016-07-18T18:04:16Z")

</div>

We have the following setup:

Client -\> haproxy -\> multiple servers running nginx (different certs)

Which in some cases works and in some it does not. I was tracing via tcpdump and sometimes the client doesn´t send the server name in the hello packet. Testing with Chrome and Firefox.

The config is derived from this example:  
([http://blog.haproxy.com/2012/04/13/enhanced-ssl-load-balancing-with-server-name-indication-sni-tls-extension/](http://blog.haproxy.com/2012/04/13/enhanced-ssl-load-balancing-with-server-name-indication-sni-tls-extension/))

# Adjust the timeout to your needs

defaults  
timeout client 30s  
timeout server 30s  
timeout connect 5s

# Single VIP

frontend ft\_ssl\_vip  
bind 10.0.0.10:443  
mode tcp

tcp-request inspect-delay 5s  
tcp-request content accept if { req\_ssl\_hello\_type 1 }

default\_backend bk\_ssl\_default

# Using SNI to take routing decision

backend bk\_ssl\_default  
mode tcp

acl application\_1 req\_ssl\_sni -i [application1.domain.com](http://application1.domain.com)  
acl application\_2 req\_ssl\_sni -i [application2.domain.com](http://application2.domain.com)

use-server server1 if application\_1  
use-server server2 if application\_2  
use-server server3 if !application\_1 !application\_2

option ssl-hello-chk  
server server1 10.0.0.11:443 check  
server server2 10.0.0.12:443 check  
server server3 10.0.0.13:443 check

Maybe the example is outdated?

haproxy -v  
HA-Proxy version 1.6.6 2016/06/26  
Copyright 2000-2016 Willy Tarreau [willy@haproxy.org](mailto:willy@haproxy.org)

---

<div class="post-metadata">

### Author: ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)
#### Post date: [July 25, 2016, 11:48am UTC](https://discourse.haproxy.org/t/sni-works-somtimes-sometimes-is-broken/509/2 "2016-07-25T11:48:48Z")

</div>

I’m not sure what you are saying. You concluded that the browsers sometimes don’t send SNI, so the configuration doesn’t work.

What exactly is your question?
