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]
### Added
- use multiple ssl certificates on one frontend
## v1.1.0 - 2021-08-15
### Added

View file

@ -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:

View file

@ -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 %}