Skip to content

Commit

Permalink
dont deploy "ssl on" on nginx 1.15 or newer (for mailhost)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhykw committed Dec 10, 2018
1 parent 705c19b commit e3137af
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion spec/defines/resource_mailhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@
title: 'should set the IPv4 SSL listen port',
attr: 'ssl_port',
value: 45,
match: ' listen *:45;'
match: ' listen *:45 ssl;'
},
{
title: 'should enable IPv6',
Expand Down
2 changes: 2 additions & 0 deletions templates/mailhost/mailhost.erb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ server {
<%- end -%>
<%= scope.function_template(["nginx/mailhost/mailhost_common.erb"]) -%>

<% if @add_listen_directive -%>
ssl off;
<% end -%>
starttls <%= @starttls %>;

<% if @starttls == 'on' || @starttls == 'only' %>
Expand Down
6 changes: 4 additions & 2 deletions templates/mailhost/mailhost_ssl.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ server {
<% end -%>
<%- if @listen_ip.is_a?(Array) then -%>
<%- @listen_ip.each do |ip| -%>
listen <%= ip %>:<%= @ssl_port %>;
listen <%= ip %>:<%= @ssl_port %><% unless @add_listen_directive -%> ssl<% end -%>;
<%- end -%>
<%- else -%>
listen <%= @listen_ip %>:<%= @ssl_port %>;
listen <%= @listen_ip %>:<%= @ssl_port %><% unless @add_listen_directive -%> ssl<% end -%>;
<%- end -%>
<%# check to see if ipv6 support exists in the kernel before applying -%>
<%# FIXME this logic is duplicated all over the place -%>
Expand All @@ -38,7 +38,9 @@ server {
<%- end -%>
<%= scope.function_template(["nginx/mailhost/mailhost_common.erb"]) -%>

<% if @add_listen_directive -%>
ssl on;
<% end -%>
starttls off;

<%= scope.function_template(["nginx/mailhost/mailhost_ssl_settings.erb"]) -%>
Expand Down

0 comments on commit e3137af

Please sign in to comment.