Skip to content

Commit

Permalink
Merge pull request #798 from rchicoli/ssl_verify_client
Browse files Browse the repository at this point in the history
add ssl_verify_client parameter
  • Loading branch information
3flex committed Apr 12, 2016
2 parents f13fdc0 + e43d8dc commit b4946b7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions manifests/resource/vhost.pp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
# for SSL Support. This is not generated by this module.
# [*ssl_client_cert*] - Pre-generated SSL Certificate file to reference
# for client verify SSL Support. This is not generated by this module.
# [*ssl_verify_client*] - Enables verification of client certificates.
# [*ssl_crl*] - String: Specifies CRL path in file system
# [*ssl_dhparam*] - This directive specifies a file containing
# Diffie-Hellman key agreement protocol cryptographic parameters, in PEM
Expand Down Expand Up @@ -191,6 +192,7 @@
$ssl_listen_option = true,
$ssl_cert = undef,
$ssl_client_cert = undef,
$ssl_verify_client = 'on',
$ssl_dhparam = undef,
$ssl_key = undef,
$ssl_port = 443,
Expand Down Expand Up @@ -322,6 +324,9 @@
if ($ssl_client_cert != undef) {
validate_string($ssl_client_cert)
}
if ($ssl_verify_client != undef) {
validate_string($ssl_verify_client)
}
if ($ssl_crl != undef) {
validate_string($ssl_crl)
}
Expand Down
3 changes: 2 additions & 1 deletion spec/defines/resource_vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -922,12 +922,13 @@
:ssl_key => 'dummy.key',
:ssl_cert => 'dummy.cert',
:ssl_client_cert => 'client.cert',
:ssl_verify_client => 'optional',
}) end

it { is_expected.to contain_nginx__resource__location("#{title}-default").with_ssl_only(true) }
it { is_expected.to contain_concat__fragment("#{title}-ssl-header").with_content(%r{access_log\s+/var/log/nginx/ssl-www\.rspec\.example\.com\.access\.log combined;}) }
it { is_expected.to contain_concat__fragment("#{title}-ssl-header").with_content(%r{error_log\s+/var/log/nginx/ssl-www\.rspec\.example\.com\.error\.log}) }
it { is_expected.to contain_concat__fragment("#{title}-ssl-header").with_content(%r{ssl_verify_client on;}) }
it { is_expected.to contain_concat__fragment("#{title}-ssl-header").with_content(%r{ssl_verify_client\s+optional;}) }
end
context 'when passenger_cgi_param is set' do
let :params do default_params.merge({
Expand Down
2 changes: 1 addition & 1 deletion templates/vhost/vhost_ssl_settings.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
ssl_certificate_key <%= @ssl_key %>;
<% if defined? @ssl_client_cert -%>
ssl_client_certificate <%= @ssl_client_cert %>;
ssl_verify_client on;
ssl_verify_client <%= @ssl_verify_client %>;
<% end -%>
<% if defined? @ssl_dhparam -%>
ssl_dhparam <%= @ssl_dhparam %>;
Expand Down

0 comments on commit b4946b7

Please sign in to comment.