Skip to content

Commit b3b9a82

Browse files
committed
Allow ssl_protocol to be empty
On EL8+ the default ssl.conf file doesn't specify SSLProtocol at all, which implies using the system profile where it can be changed. This changes the template to deal with ssl_protocol set to an empty array, which was previously generating invalid syntax anyway.
1 parent 88f611e commit b3b9a82

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

spec/classes/mod/ssl_spec.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@
3333

3434
it { is_expected.to contain_file('ssl.conf').with_content(%r{SSLProxyCipherSuite PROFILE=system}) }
3535
end
36+
37+
context 'with empty ssl_protocol' do
38+
let(:params) do
39+
{
40+
ssl_protocol: [],
41+
}
42+
end
43+
44+
it { is_expected.to contain_file('ssl.conf').without_content(%r{SSLProtocol}) }
45+
end
3646
end
3747

3848
context '7 OS with custom directories for PR#1635' do

templates/mod/ssl.conf.erb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@
4040
SSLStaplingCache "shmcb:<%= @_stapling_cache %>"
4141
<% end -%>
4242
SSLCipherSuite <%= @ssl_cipher %>
43+
<% if not @ssl_protocol.empty? -%>
4344
SSLProtocol <%= @ssl_protocol.compact.join(' ') %>
45+
<% end -%>
4446
<% if not @ssl_proxy_protocol.empty? -%>
4547
SSLProxyProtocol <%= @ssl_proxy_protocol.compact.join(' ') %>
4648
<% end -%>

0 commit comments

Comments
 (0)