diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d2cf95..aac00b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/) ## [Unreleased] +### Added + +- use multiple ssl certificates on one frontend + ## v1.1.0 - 2021-08-15 ### Added diff --git a/README.md b/README.md index e6deded..46762fd 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,9 @@ Install and configure haproxy ip: '*' port: 443 ssl: + cert: + - /etc/haproxy/ssl1.pem + - /etc/haproxy/ssl2.pem default_backend: backend-app frontend-http: bind: diff --git a/templates/haproxy.cfg.j2 b/templates/haproxy.cfg.j2 index 7b2afcf..69c1abb 100644 --- a/templates/haproxy.cfg.j2 +++ b/templates/haproxy.cfg.j2 @@ -71,7 +71,7 @@ userlist {{ userlist }} frontend {{ frontend }} {% for key, value in config.items() %} {% if key == "bind" %} - bind {{ value["ip"] }}:{{ value["port"] }}{% if value["ssl"] is defined %} ssl{% if value["ssl"]["ciphers"] is defined %} ciphers {{ value["ssl"]["ciphers"]|join(':') }}{% endif %}{% if value["ssl"]["crt"]%} crt {{ value["ssl"]["crt"] }}{% endif %} + bind {{ value["ip"] }}:{{ value["port"] }}{% if value["ssl"] is defined %} ssl{% if value["ssl"]["ciphers"] is defined %} ciphers {{ value["ssl"]["ciphers"]|join(':') }}{% endif %}{% if value["ssl"]["crt"]%} crt {% if value["ssl"]["crt"] is string %}{{ value["ssl"]["crt"] }}{% else %}{{ value["ssl"]["crt"]|join(' crt ') }}{% endif %}{% endif %} {% endif %} {% elif value is iterable and value is not string %}