0

I am trying to configure Pass through SSL using HAproxy but I get a lot of errors

here my example

error detected while parsing ACL

frontend public_ssl
        mode tcp
        option tcplog
        bind *:443

        tcp-request inspect-delay 5s
        tcp-request content accept if { req.ssl_hello_type 1 }

        acl foo_app_bar req.ssl_sni -i bar.example.com
        acl foo_app_baz req.ssl_sni -i baz.example.com

        use_backend foo_bk_bar if foo_app_bar
        use_backend foo_bk_baz if foo_app_baz

        default_backend foo_bk_default

But I am getting following errors

[ALERT] 339/143013 (3828) : parsing [/etc/haproxy/haproxy.cfg:45] : error detected in frontend 'public_ssl' while parsing 'if' condition
[ALERT] 339/143013 (3828) : parsing [/etc/haproxy/haproxy.cfg:47] : error detected while parsing ACL 'foo_app_bar'.
[ALERT] 339/143013 (3828) : parsing [/etc/haproxy/haproxy.cfg:48] : error detected while parsing ACL 'foo_app_baz'.
[ALERT] 339/143013 (3828) : parsing [/etc/haproxy/haproxy.cfg:50] : error detected while parsing switching rule.
[ALERT] 339/143013 (3828) : parsing [/etc/haproxy/haproxy.cfg:51] : error detected while parsing switching rule.
[ALERT] 339/143013 (3828) : Error(s) found in configuration file : /etc/haproxy/haproxy.cfg

I have tried to use code example from a lot of tutorials and articles even from official site, but each time I get parsing errors.

cyeostoragrn
  • 19
  • 2
  • 11

1 Answers1

1

Thanks everyone for help. The problem was in ancient version of HAProxy. Because I've installed it using apt-get install haproxy. Version 1.4 2013

I have just compiled the recent version 1.7 from sources and it started fine.

Thanks.

cyeostoragrn
  • 19
  • 2
  • 11