feat: use multiple ssl certificates on one frontend

This commit is contained in:
Adrien Waksberg 2021-11-04 14:32:06 +01:00
parent fbc4c05ecd
commit 90d77d0945
3 changed files with 8 additions and 1 deletions

View file

@ -5,6 +5,10 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
## [Unreleased] ## [Unreleased]
### Added
- use multiple ssl certificates on one frontend
## v1.1.0 - 2021-08-15 ## v1.1.0 - 2021-08-15
### Added ### Added

View file

@ -90,6 +90,9 @@ Install and configure haproxy
ip: '*' ip: '*'
port: 443 port: 443
ssl: ssl:
cert:
- /etc/haproxy/ssl1.pem
- /etc/haproxy/ssl2.pem
default_backend: backend-app default_backend: backend-app
frontend-http: frontend-http:
bind: bind:

View file

@ -71,7 +71,7 @@ userlist {{ userlist }}
frontend {{ frontend }} frontend {{ frontend }}
{% for key, value in config.items() %} {% for key, value in config.items() %}
{% if key == "bind" %} {% 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 %} {% endif %}
{% elif value is iterable and value is not string %} {% elif value is iterable and value is not string %}