Skip to content

Commit 1ef4aa2

Browse files
authored
Merge pull request puppetlabs#1612 from JAORMX/ssl-ca
Enable configuring CA file in ssl.conf
2 parents 194076e + ad5c81a commit 1ef4aa2

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -1202,6 +1202,10 @@ Determines whether Puppet manages the HTTPD service's state. Valid options: Bool
12021202

12031203
Determines whether Puppet should use a specific command to restart the HTTPD service. Valid options: a command to restart the Apache service. Default: undef, which uses the [default Puppet behavior][Service attribute restart].
12041204

1205+
##### `ssl_ca`
1206+
1207+
Specifies the SSL certificate authority. [SSLCACertificateFile](https://httpd.apache.org/docs/current/mod/mod_ssl.html#sslcacertificatefile). Default: undef. It is possible to override this on a vhost level.
1208+
12051209
##### `ssl_stapling`
12061210

12071211
Specifies whether or not to use [SSLUseStapling](http://httpd.apache.org/docs/current/mod/mod_ssl.html#sslusestapling). Valid options: Boolean. Default: false. It is possible to override this on a vhost level.

manifests/mod/ssl.pp

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
$ssl_cryptodevice = 'builtin',
44
$ssl_options = [ 'StdEnvVars' ],
55
$ssl_openssl_conf_cmd = undef,
6+
$ssl_ca = undef,
67
$ssl_cipher = 'HIGH:MEDIUM:!aNULL:!MD5:!RC4',
78
$ssl_honorcipherorder = true,
89
$ssl_protocol = [ 'all', '-SSLv2', '-SSLv3' ],
@@ -104,6 +105,7 @@
104105
#
105106
# $ssl_compression
106107
# $ssl_cryptodevice
108+
# $ssl_ca
107109
# $ssl_cipher
108110
# $ssl_honorcipherorder
109111
# $ssl_options

spec/classes/mod/ssl_spec.rb

+8
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,14 @@
136136
it { is_expected.to contain_file('ssl.conf').with_content(/^ SSLPassPhraseDialog builtin$/)}
137137
end
138138

139+
context 'setting ssl_ca to a path' do
140+
let :params do
141+
{
142+
:ssl_ca => '/etc/pki/some/path/ca.crt',
143+
}
144+
end
145+
it { is_expected.to contain_file('ssl.conf').with_content(/^ SSLCACertificateFile/)}
146+
end
139147
context "with Apache version < 2.4" do
140148
let :params do
141149
{

templates/mod/ssl.conf.erb

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
<%- end -%>
2121
SSLCryptoDevice <%= @ssl_cryptodevice %>
2222
SSLHonorCipherOrder <%= scope.function_bool2httpd([@_ssl_honorcipherorder]) %>
23+
<%- if @ssl_ca -%>
24+
SSLCACertificateFile "<%= @ssl_ca %>"
25+
<%- end -%>
2326
<% if scope.function_versioncmp([@_apache_version, '2.4']) >= 0 -%>
2427
SSLUseStapling <%= scope.function_bool2httpd([@ssl_stapling]) %>
2528
<%- if not @ssl_stapling_return_errors.nil? -%>

0 commit comments

Comments
 (0)