diff --git a/chart/templates/mattermost/mattermost/mattermost-helmrelease.yaml b/chart/templates/mattermost/mattermost/mattermost-helmrelease.yaml
index c94b45ade3e5656cffbda4c8361ae112a2122aff..373b3733891199f5dfbece43de9e51aed0b07ad0 100644
--- a/chart/templates/mattermost/mattermost/mattermost-helmrelease.yaml
+++ b/chart/templates/mattermost/mattermost/mattermost-helmrelease.yaml
@@ -66,7 +66,7 @@ spec:
       license: {{ .license }}
     {{- end }}
     {{- with .Values.addons.mattermost.database }}
-    {{- if and .username .password .host .port .database .ssl_mode }}
+    {{- if and .username .password .host .port .database }}
     database:
       secret: "mattermost-database-secret"
     {{- else }}
diff --git a/chart/templates/mattermost/mattermost/namespace.yaml b/chart/templates/mattermost/mattermost/namespace.yaml
index d4283a71ab3f10f8488385d997b83148f34d8896..a52632cc6eb87ba15e29764699a1c55d0e404edf 100644
--- a/chart/templates/mattermost/mattermost/namespace.yaml
+++ b/chart/templates/mattermost/mattermost/namespace.yaml
@@ -27,7 +27,7 @@ data:
 
 ---
 {{- with .Values.addons.mattermost.database }}
-{{- if and .username .password .host .port .database .ssl_mode }}
+{{- if and .username .password .host .port .database }}
 apiVersion: v1
 kind: Secret
 type: Opaque
@@ -39,8 +39,8 @@ metadata:
     app.kubernetes.io/component: "collaboration-tools"
     {{- include "commonLabels" $ | nindent 4}}
 stringData:
-  DB_CONNECTION_CHECK_URL: "postgres://{{ .username }}:{{ .password }}@{{ .host }}:{{ .port }}/{{ .database }}?connect_timeout=10&sslmode={{ .ssl_mode }}"
-  DB_CONNECTION_STRING: "postgres://{{ .username }}:{{ .password }}@{{ .host }}:{{ .port }}/{{ .database }}?connect_timeout=10&sslmode={{ .ssl_mode }}"
+  DB_CONNECTION_CHECK_URL: "postgres://{{ .username }}:{{ .password }}@{{ .host }}:{{ .port }}/{{ .database }}?connect_timeout=10&sslmode={{ .ssl_mode | default "disable" }}"
+  DB_CONNECTION_STRING: "postgres://{{ .username }}:{{ .password }}@{{ .host }}:{{ .port }}/{{ .database }}?connect_timeout=10&sslmode={{ .ssl_mode | default "disable" }}"
 {{- end }}
 {{- end }}