Skip to content

Commit 4c5e171

Browse files
author
Morgan Haskel
committed
Merge pull request #1127 from tmuellerleile/add-openssl-conf-cmd
Add ssl_openssl_conf_cmd param (apache::mod::ssl and apache::vhost)
2 parents 22b2dd9 + c7ce06c commit 4c5e171

File tree

7 files changed

+27
-0
lines changed

7 files changed

+27
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,6 +823,7 @@ Installs Apache SSL capabilities and uses the ssl.conf.erb template. These are t
823823
ssl_compression => false,
824824
ssl_cryptodevice => 'builtin',
825825
ssl_options => [ 'StdEnvVars' ],
826+
ssl_openssl_conf_cmd => undef,
826827
ssl_cipher => 'HIGH:MEDIUM:!aNULL:!MD5',
827828
ssl_honorcipherorder => 'On',
828829
ssl_protocol => [ 'all', '-SSLv2', '-SSLv3' ],
@@ -2251,6 +2252,10 @@ An array:
22512252
}
22522253
```
22532254

2255+
#####`ssl_openssl_conf_cmd`
2256+
2257+
Sets the [SSLOpenSSLConfCmd](http://httpd.apache.org/docs/current/mod/mod_ssl.html#sslopensslconfcmd) directive, which provides direct configuration of OpenSSL parameters. Defaults to 'undef'.
2258+
22542259
#####`ssl_proxyengine`
22552260

22562261
Specifies whether or not to use [SSLProxyEngine](http://httpd.apache.org/docs/current/mod/mod_ssl.html#sslproxyengine). Valid values are 'true' and 'false'. Defaults to 'false'.

manifests/mod/ssl.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
$ssl_compression = false,
33
$ssl_cryptodevice = 'builtin',
44
$ssl_options = [ 'StdEnvVars' ],
5+
$ssl_openssl_conf_cmd = undef,
56
$ssl_cipher = 'HIGH:MEDIUM:!aNULL:!MD5',
67
$ssl_honorcipherorder = 'On',
78
$ssl_protocol = [ 'all', '-SSLv2', '-SSLv3' ],
@@ -57,6 +58,7 @@
5758
# $ssl_cipher
5859
# $ssl_honorcipherorder
5960
# $ssl_options
61+
# $ssl_openssl_conf_cmd
6062
# $session_cache
6163
# $ssl_mutex
6264
# $ssl_random_seed_bytes

manifests/vhost.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
$ssl_verify_client = undef,
2727
$ssl_verify_depth = undef,
2828
$ssl_options = undef,
29+
$ssl_openssl_conf_cmd = undef,
2930
$ssl_proxyengine = false,
3031
$priority = undef,
3132
$default_vhost = false,
@@ -729,6 +730,7 @@
729730
# - $ssl_verify_client
730731
# - $ssl_verify_depth
731732
# - $ssl_options
733+
# - $ssl_openssl_conf_cmd
732734
# - $apache_version
733735
if $ssl {
734736
concat::fragment { "${name}-ssl":

spec/classes/mod/ssl_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,5 +136,14 @@
136136
end
137137
it { is_expected.to contain_file('ssl.conf').with_content(%r{^ SSLRandomSeed startup file:/dev/urandom 1024$})}
138138
end
139+
140+
context 'setting ssl_openssl_conf_cmd' do
141+
let :params do
142+
{
143+
:ssl_openssl_conf_cmd => 'DHParameters "foo.pem"',
144+
}
145+
end
146+
it { is_expected.to contain_file('ssl.conf').with_content(/^\s+SSLOpenSSLConfCmd DHParameters "foo.pem"$/)}
147+
end
139148
end
140149
end

spec/defines/vhost_spec.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@
153153
'ssl_verify_client' => 'optional',
154154
'ssl_verify_depth' => '3',
155155
'ssl_options' => '+ExportCertData',
156+
'ssl_openssl_conf_cmd' => 'DHParameters "foo.pem"',
156157
'ssl_proxyengine' => true,
157158
'priority' => '30',
158159
'default_vhost' => true,
@@ -398,6 +399,8 @@
398399
it { is_expected.to contain_concat__fragment('rspec.example.com-serveralias') }
399400
it { is_expected.to contain_concat__fragment('rspec.example.com-setenv') }
400401
it { is_expected.to contain_concat__fragment('rspec.example.com-ssl') }
402+
it { is_expected.to contain_concat__fragment('rspec.example.com-ssl').with(
403+
:content => /^\s+SSLOpenSSLConfCmd\s+DHParameters "foo.pem"$/ ) }
401404
it { is_expected.to contain_concat__fragment('rspec.example.com-suphp') }
402405
it { is_expected.to contain_concat__fragment('rspec.example.com-php_admin') }
403406
it { is_expected.to contain_concat__fragment('rspec.example.com-header') }

templates/mod/ssl.conf.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,7 @@
2525
<% if @ssl_options -%>
2626
SSLOptions <%= @ssl_options.compact.join(' ') %>
2727
<% end -%>
28+
<%- if @ssl_openssl_conf_cmd -%>
29+
SSLOpenSSLConfCmd <%= @ssl_openssl_conf_cmd %>
30+
<%- end -%>
2831
</IfModule>

templates/vhost/_ssl.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,7 @@
4343
<%- if @ssl_options -%>
4444
SSLOptions <%= Array(@ssl_options).join(' ') %>
4545
<%- end -%>
46+
<%- if @ssl_openssl_conf_cmd -%>
47+
SSLOpenSSLConfCmd <%= @ssl_openssl_conf_cmd %>
48+
<%- end -%>
4649
<% end -%>

0 commit comments

Comments
 (0)