-
- Downloads
Validate that SMTP settings do not enable both TLS and STARTTLS
GitLab versions 15.10.4 and up shipped with https://gitlab.com/gitlab-org/gitlab/-/merge_requests/116925 in order to fix a Ruby 3 upgrade issue that made it impossible to disable STARTTLS if the SMTP server advertised support for it. However, this change enforced the constraint that both SMTP TLS and STARTTLS cannot be enabled simultaneously. This follows the behavior of the net-smtp gem, which raises an exception if a user attempts to enable both. This constraint was added because as described in https://github.com/mikel/mail/pull/1536, the logic for enabling/disabling TLS and/or STARTTLS is a bit tricky to get right and missed some important edge cases. This commit adds a validation step that will throw an error if both settings appear: ```ruby gitlab_rails['smtp_tls'] = true gitlab_rails['smtp_enable_starttls_auto'] = true ``` Previously if SMTP TLS were enabled, STARTTLS was disabled outright. If `gitlab_rails['smtp_tls']` is enabled, generally the easiest way to get things working is to set `gitlab_rails['smtp_enable_starttls_auto']` to `false`. Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/409835 Also see https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/6858 Changelog: changed
Showing
- files/gitlab-cookbooks/gitlab/libraries/gitlab_rails.rb 5 additions, 0 deletionsfiles/gitlab-cookbooks/gitlab/libraries/gitlab_rails.rb
- files/gitlab-cookbooks/gitlab/libraries/smtp_helper.rb 11 additions, 0 deletionsfiles/gitlab-cookbooks/gitlab/libraries/smtp_helper.rb
- spec/chef/cookbooks/gitlab/recipes/gitlab-rails_spec.rb 52 additions, 0 deletionsspec/chef/cookbooks/gitlab/recipes/gitlab-rails_spec.rb
Please register or sign in to comment