Skip to content

Commit

Permalink
Merge pull request #1268 from traylenator/sslopts
Browse files Browse the repository at this point in the history
(MODULES-2834) Support SSLProxyCheckPeerCN and SSLProxyCheckPeerName …
  • Loading branch information
igalic committed Dec 2, 2015
2 parents 02229e5 + da972b9 commit 61fe6ad
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3186,6 +3186,15 @@ Sets the [SSLProxyMachineCertificateFile](http://httpd.apache.org/docs/current/m
}
~~~

##### `ssl_proxy_check_peer_cn`

Sets the [SSLProxyMachinePeerCN](http://httpd.apache.org/docs/current/mod/mod_ssl.html#sslproxycheckpeercn) directive, which specified whether the remote server certificate's CN field is compared against the hostname of the request URL . Defaults to 'undef'.


##### `ssl_proxy_check_peer_name`

Sets the [SSLProxyMachinePeerName](http://httpd.apache.org/docs/current/mod/mod_ssl.html#sslproxycheckpeername) directive, which specified whether the remote server certificate's CN field is compared against the hostname of the request URL . Defaults to 'undef'.

##### `ssl_options`

Sets the [SSLOptions](http://httpd.apache.org/docs/current/mod/mod_ssl.html#ssloptions) directive, which configures various SSL engine run-time options. This is the global setting for the given vhost and can be a string or an array. Defaults to 'undef'.
Expand Down
12 changes: 12 additions & 0 deletions manifests/vhost.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
$ssl_honorcipherorder = undef,
$ssl_verify_client = undef,
$ssl_verify_depth = undef,
$ssl_proxy_check_peer_cn = undef,
$ssl_proxy_check_peer_name = undef,
$ssl_proxy_machine_cert = undef,
$ssl_options = undef,
$ssl_openssl_conf_cmd = undef,
Expand Down Expand Up @@ -236,6 +238,14 @@
if $manage_docroot {
validate_string($docroot)
}

if $ssl_proxy_check_peer_cn {
validate_re($ssl_proxy_check_peer_cn,'(^on$|^off$)',"${ssl_proxy_check_peer_cn} is not permitted for ssl_proxy_check_peer_cn. Allowed values are 'on' or 'off'.")
}
if $ssl_proxy_check_peer_name {
validate_re($ssl_proxy_check_peer_name,'(^on$|^off$)',"${ssl_proxy_check_peer_name} is not permitted for ssl_proxy_check_peer_name. Allowed values are 'on' or 'off'.")
}

# Input validation ends

if $ssl and $ensure == 'present' {
Expand Down Expand Up @@ -784,6 +794,8 @@
# - $ssl_honorcipherorder
# - $ssl_verify_client
# - $ssl_verify_depth
# - $ssl_proxy_check_peer_cn
# - $ssl_proxy_check_peer_name
# - $ssl_proxy_machine_cert
# - $ssl_options
# - $ssl_openssl_conf_cmd
Expand Down
7 changes: 7 additions & 0 deletions spec/defines/vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@
'ssl_verify_depth' => '3',
'ssl_options' => '+ExportCertData',
'ssl_openssl_conf_cmd' => 'DHParameters "foo.pem"',
'ssl_proxy_check_peer_cn' => 'on',
'ssl_proxy_check_peer_name' => 'on',
'ssl_proxyengine' => true,

'priority' => '30',
'default_vhost' => true,
'servername' => 'example.com',
Expand Down Expand Up @@ -432,6 +435,10 @@
it { is_expected.to contain_concat__fragment('rspec.example.com-ssl') }
it { is_expected.to contain_concat__fragment('rspec.example.com-ssl').with(
:content => /^\s+SSLOpenSSLConfCmd\s+DHParameters "foo.pem"$/ ) }
it { is_expected.to contain_concat__fragment('rspec.example.com-ssl').with(
:content => /^\s+SSLProxyCheckPeerCN\s+on$/ ) }
it { is_expected.to contain_concat__fragment('rspec.example.com-ssl').with(
:content => /^\s+SSLProxyCheckPeerName\s+on$/ ) }
it { is_expected.to contain_concat__fragment('rspec.example.com-suphp') }
it { is_expected.to contain_concat__fragment('rspec.example.com-php_admin') }
it { is_expected.to contain_concat__fragment('rspec.example.com-header') }
Expand Down
6 changes: 6 additions & 0 deletions templates/vhost/_ssl.erb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@
<%- if @ssl_verify_depth -%>
SSLVerifyDepth <%= @ssl_verify_depth %>
<%- end -%>
<%- if @ssl_proxy_check_peer_cn -%>
SSLProxyCheckPeerCN <%= @ssl_proxy_check_peer_cn %>
<%- end -%>
<%- if @ssl_proxy_check_peer_name -%>
SSLProxyCheckPeerName <%= @ssl_proxy_check_peer_name %>
<%- end -%>
<%- if @ssl_proxy_machine_cert -%>
SSLProxyMachineCertificateFile "<%= @ssl_proxy_machine_cert %>"
<%- end -%>
Expand Down

0 comments on commit 61fe6ad

Please sign in to comment.