Skip to content

Commit bdaaf97

Browse files
author
Matt Dainty
committed
Add ssl_user_name vhost parameter
Maps to SSLUserName directive.
1 parent 14ff1b8 commit bdaaf97

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

manifests/vhost.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1673,6 +1673,9 @@
16731673
# Can be used to set the [SSLStaplingReturnResponderErrors](http://httpd.apache.org/docs/current/mod/mod_ssl.html#sslstaplingreturnrespondererrors) directive.<br />
16741674
# This parameter only applies to Apache 2.4 or higher and is ignored on older versions.
16751675
#
1676+
# @param ssl_user_name
1677+
# Sets the [SSLUserName](https://httpd.apache.org/docs/current/mod/mod_ssl.html#sslusername) directive.
1678+
#
16761679
# @param use_canonical_name
16771680
# Specifies whether to use the [`UseCanonicalName directive`](https://httpd.apache.org/docs/2.4/mod/core.html#usecanonicalname),
16781681
# which allows you to configure how the server determines it's own name and port.
@@ -1767,6 +1770,7 @@
17671770
Optional[Boolean] $ssl_stapling = undef,
17681771
$ssl_stapling_timeout = undef,
17691772
$ssl_stapling_return_errors = undef,
1773+
Optional[String] $ssl_user_name = undef,
17701774
$priority = undef,
17711775
Boolean $default_vhost = false,
17721776
$servername = $name,

spec/defines/vhost_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
'ssl_proxyengine' => true,
8686
'ssl_proxy_cipher_suite' => 'HIGH',
8787
'ssl_proxy_protocol' => 'TLSv1.2',
88+
'ssl_user_name' => 'SSL_CLIENT_S_DN_CN',
8889
'priority' => '30',
8990
'default_vhost' => true,
9091
'servername' => 'example.com',
@@ -1027,6 +1028,11 @@
10271028
content: %r{^\s+SSLOpenSSLConfCmd\s+DHParameters "foo.pem"$},
10281029
)
10291030
}
1031+
it {
1032+
is_expected.to contain_concat__fragment('rspec.example.com-ssl').with(
1033+
content: %r{^\s+SSLUserName\s+SSL_CLIENT_S_DN_CN$},
1034+
)
1035+
}
10301036
it { is_expected.to contain_concat__fragment('rspec.example.com-sslproxy') }
10311037
it {
10321038
is_expected.to contain_concat__fragment('rspec.example.com-sslproxy').with(

templates/vhost/_ssl.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,7 @@
5252
<%- if (not @ssl_stapling_return_errors.nil?) && (scope.function_versioncmp([@apache_version, '2.4']) >= 0) -%>
5353
SSLStaplingReturnResponderErrors <%= scope.call_function('apache::bool2httpd', [@ssl_stapling_return_errors]) %>
5454
<%- end -%>
55+
<%- if @ssl_user_name -%>
56+
SSLUserName <%= @ssl_user_name %>
57+
<%- end -%>
5558
<% end -%>

0 commit comments

Comments
 (0)