From 21fc8321e9a89bc19ed72a452a8b70c01f483547 Mon Sep 17 00:00:00 2001
From: Benaissa BENARBIA <ben.benarbia@gmail.com>
Date: Fri, 10 Sep 2021 10:19:00 +0200
Subject: [PATCH] fix tls versions for mail settings

---
 deployment/environments/group_vars/all/infra.yml                | 2 +-
 .../roles/vitamui/templates/cas-server/application.yml.j2       | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/deployment/environments/group_vars/all/infra.yml b/deployment/environments/group_vars/all/infra.yml
index 8d369f841..01b1ff32f 100755
--- a/deployment/environments/group_vars/all/infra.yml
+++ b/deployment/environments/group_vars/all/infra.yml
@@ -1,4 +1,3 @@
-
 smtp:
   host: host
   port: 389
@@ -12,6 +11,7 @@ smtp:
     checkserveridentity: false
     trust: "*"
     timeout: 8000
+    protocols: "TLSv1.2 TLSv1.3"
   cas:
     sender: "serveur-cas@noreply.com"
     expiration: 1440 # 1 Day : 24 * 60 Minutes to reset password
diff --git a/deployment/roles/vitamui/templates/cas-server/application.yml.j2 b/deployment/roles/vitamui/templates/cas-server/application.yml.j2
index 0da7c75cc..9b800238f 100644
--- a/deployment/roles/vitamui/templates/cas-server/application.yml.j2
+++ b/deployment/roles/vitamui/templates/cas-server/application.yml.j2
@@ -130,6 +130,7 @@ spring.mail.properties.mail.transport.protocol: {{ smtp.protocol|lower }}
 spring.mail.properties.mail.smtps.ssl.checkserveridentity: {{ smtp.smtps.checkserveridentity|lower }}
 spring.mail.properties.mail.smtps.ssl.trust: "{{ smtp.smtps.trust|lower }}"
 spring.mail.properties.mail.smtps.timeout: {{ smtp.smtps.timeout|default('8000') }}
+spring.mail.properties.mail.smtps.ssl.protocols: {{ smtp.smtps.ssl.protocols}}
 {% endif %}
 
 
-- 
GitLab