Skip to content

Commit

Permalink
Support setting ssl_verify_depth in nginx::resource::server
Browse files Browse the repository at this point in the history
This adds support for specifying the `ssl_verify_depth` option in server
sections.
  • Loading branch information
Taylan Develioglu committed Apr 25, 2018
1 parent 6103b40 commit 82d7b30
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions manifests/resource/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
# [*ssl_session_tickets*] - String: Enables or disables session resumption through TLS session tickets.
# [*ssl_session_ticket_key*] - String: Sets a file with the secret key used to encrypt and decrypt TLS session tickets.
# [*ssl_trusted_cert*] - String: Specifies a file with trusted CA certificates in the PEM format used to verify client
# [*ssl_verify_depth*] - Integer: Sets the verification depth in the client certificates chain.
# certificates and OCSP responses if ssl_stapling is enabled.
# [*spdy*] - Toggles SPDY protocol.
# [*http2*] - Toggles HTTP/2 protocol.
Expand Down Expand Up @@ -179,6 +180,7 @@
Optional[String] $ssl_session_tickets = undef,
Optional[String] $ssl_session_ticket_key = undef,
Optional[String] $ssl_trusted_cert = undef,
Optional[Integer] $ssl_verify_depth = undef,
String $spdy = $::nginx::spdy,
$http2 = $::nginx::http2,
Optional[String] $proxy = undef,
Expand Down
6 changes: 6 additions & 0 deletions spec/defines/resource_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,12 @@
value: '/tmp/trusted_certificate',
match: %r{\s+ssl_trusted_certificate\s+/tmp/trusted_certificate;}
},
{
title: 'should set ssl_verify_depth',
attr: 'ssl_verify_depth',
value: 2,
match: %r{^\s+ssl_verify_depth\s+2;}
},
{
title: 'should set the SSL cache',
attr: 'ssl_cache',
Expand Down
3 changes: 3 additions & 0 deletions templates/server/server_ssl_settings.erb
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,7 @@
<%- if defined? @ssl_trusted_cert -%>
ssl_trusted_certificate <%= @ssl_trusted_cert %>;
<%- end -%>
<%- if @ssl_verify_depth -%>
ssl_verify_depth <%= @ssl_verify_depth %>;
<%- end -%>
<% end -%>

0 comments on commit 82d7b30

Please sign in to comment.