Skip to content

Commit b66ad26

Browse files
authored
Merge pull request puppetlabs#1571 from AntagonistHQ/server_ssl_stapling_return_errors
Add ability to set SSLStaplingReturnResponderErrors on server level
2 parents 59e59e8 + cc9a7a5 commit b66ad26

File tree

5 files changed

+39
-16
lines changed

5 files changed

+39
-16
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,6 +1185,12 @@ Specifies whether or not to use [SSLUseStapling](http://httpd.apache.org/docs/cu
11851185

11861186
This parameter only applies to Apache 2.4 or higher and is ignored on older versions.
11871187

1188+
##### `ssl_stapling_return_errors`
1189+
1190+
Can be used to set the [SSLStaplingReturnResponderErrors](http://httpd.apache.org/docs/current/mod/mod_ssl.html#sslstaplingreturnrespondererrors) directive. No default. It is possible to override this on a vhost level.
1191+
1192+
This parameter only applies to Apache 2.4 or higher and is ignored on older versions.
1193+
11881194
##### `timeout`
11891195

11901196
Sets Apache's [`TimeOut`][] directive, which defines the number of seconds Apache waits for certain events before failing a request. Default: 120.

manifests/mod/ssl.pp

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
class apache::mod::ssl (
2-
$ssl_compression = false,
3-
$ssl_cryptodevice = 'builtin',
4-
$ssl_options = [ 'StdEnvVars' ],
5-
$ssl_openssl_conf_cmd = undef,
6-
$ssl_cipher = 'HIGH:MEDIUM:!aNULL:!MD5:!RC4',
7-
$ssl_honorcipherorder = true,
8-
$ssl_protocol = [ 'all', '-SSLv2', '-SSLv3' ],
9-
$ssl_pass_phrase_dialog = 'builtin',
10-
$ssl_random_seed_bytes = '512',
11-
$ssl_sessioncachetimeout = '300',
12-
$ssl_stapling = false,
13-
$ssl_mutex = undef,
14-
$apache_version = undef,
15-
$package_name = undef,
2+
$ssl_compression = false,
3+
$ssl_cryptodevice = 'builtin',
4+
$ssl_options = [ 'StdEnvVars' ],
5+
$ssl_openssl_conf_cmd = undef,
6+
$ssl_cipher = 'HIGH:MEDIUM:!aNULL:!MD5:!RC4',
7+
$ssl_honorcipherorder = true,
8+
$ssl_protocol = [ 'all', '-SSLv2', '-SSLv3' ],
9+
$ssl_pass_phrase_dialog = 'builtin',
10+
$ssl_random_seed_bytes = '512',
11+
$ssl_sessioncachetimeout = '300',
12+
$ssl_stapling = false,
13+
$ssl_stapling_return_errors = undef,
14+
$ssl_mutex = undef,
15+
$apache_version = undef,
16+
$package_name = undef,
1617
) {
1718
include ::apache
1819
include ::apache::mod::mime
@@ -70,6 +71,10 @@
7071

7172
validate_bool($ssl_stapling)
7273

74+
if $ssl_stapling_return_errors != undef {
75+
validate_bool($ssl_stapling_return_errors)
76+
}
77+
7378
$stapling_cache = $::osfamily ? {
7479
'debian' => "\${APACHE_RUN_DIR}/ocsp(32768)",
7580
'redhat' => '/run/httpd/ssl_stapling(32768)',

spec/classes/mod/ssl_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,15 @@
188188
end
189189
it { is_expected.to contain_file('ssl.conf').with_content(/^ SSLUseStapling On$/)}
190190
end
191+
context 'setting ssl_stapling_return_errors to true' do
192+
let :params do
193+
{
194+
:apache_version => '2.4',
195+
:ssl_stapling_return_errors => true,
196+
}
197+
end
198+
it { is_expected.to contain_file('ssl.conf').with_content(/^ SSLStaplingReturnResponderErrors On$/)}
199+
end
191200
end
192201

193202
context 'setting ssl_pass_phrase_dialog' do

templates/mod/ssl.conf.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
SSLHonorCipherOrder <%= scope.function_bool2httpd([@_ssl_honorcipherorder]) %>
2323
<% if scope.function_versioncmp([@_apache_version, '2.4']) >= 0 -%>
2424
SSLUseStapling <%= scope.function_bool2httpd([@ssl_stapling]) %>
25+
<%- if not @ssl_stapling_return_errors.nil? -%>
26+
SSLStaplingReturnResponderErrors <%= scope.function_bool2httpd([@ssl_stapling_return_errors]) %>
27+
<%- end -%>
2528
SSLStaplingCache "shmcb:<%= @stapling_cache %>"
2629
<% end -%>
2730
SSLCipherSuite <%= @ssl_cipher %>

templates/vhost/_ssl.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
<%- if @ssl_stapling_timeout && scope.function_versioncmp([@apache_version, '2.4']) >= 0 -%>
5050
SSLStaplingResponderTimeout <%= @ssl_stapling_timeout %>
5151
<%- end -%>
52-
<%- if @ssl_stapling_return_errors && scope.function_versioncmp([@apache_version, '2.4']) >= 0 -%>
53-
SSLStaplingReturnResponderErrors <%= @ssl_stapling_return_errors %>
52+
<%- if not @ssl_stapling_return_errors.nil? && scope.function_versioncmp([@apache_version, '2.4']) >= 0 -%>
53+
SSLStaplingReturnResponderErrors <%= scope.function_bool2httpd([@ssl_stapling_return_errors]) %>
5454
<%- end -%>
5555
<% end -%>

0 commit comments

Comments
 (0)