Skip to content

Commit 5caacb0

Browse files
ehelmsekohl
authored andcommitted
Always compare CNs as downcase
1 parent 73ab73b commit 5caacb0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

manifests/container.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
'provider' => 'location',
2525
'path' => "${location_prefix}${registry_v2_path}",
2626
'request_headers' => ["set SSL_CLIENT_S_DN \"admin\""],
27-
'requires' => ["expr %{SSL_CLIENT_S_DN_CN} == \"${certs::foreman_proxy::hostname}\""]
27+
'requires' => ["expr %{tolower:%{SSL_CLIENT_S_DN_CN}} == \"${certs::foreman_proxy::hostname.downcase}\""]
2828
},
2929
],
3030
'proxy_pass' => [

spec/classes/foreman_proxy_content__container_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
.with_vhost('pulpcore-https')
1919
.with_priority('10')
2020
.with_content(%r{^\s+<Location "/pulpcore_registry/v2/">$})
21-
.with_content(%r{^\s+Require expr %\{SSL_CLIENT_S_DN_CN\} == "foo.example.com"$})
21+
.with_content(%r{^\s+Require expr %\{tolower:%\{SSL_CLIENT_S_DN_CN\}\} == "foo.example.com"$})
2222
.with_content(%r{^\s+RequestHeader set SSL_CLIENT_S_DN "admin"$})
2323
.with_content(%r{^\s+</Location>$})
2424
.with_content(%r{^\s+ProxyPass /v1/ https://foo\.example\.com:8443/container_gateway/v1/$})
@@ -37,7 +37,7 @@
3737
.with_vhost('rhsm-pulpcore-reverse-proxy-443')
3838
.with_priority('10')
3939
.with_content(%r{^\s+<Location "/other_pulpcore_registry/vr2/">$})
40-
.with_content(%r{^\s+Require expr %\{SSL_CLIENT_S_DN_CN\} == "foo.example.com"$})
40+
.with_content(%r{^\s+Require expr %\{tolower:%\{SSL_CLIENT_S_DN_CN\}\} == "foo.example.com"$})
4141
.with_content(%r{^\s+RequestHeader set SSL_CLIENT_S_DN "admin"$})
4242
.with_content(%r{^\s+</Location>$})
4343
.with_content(%r{^\s+ProxyPass /vr1/ https://foo\.example\.com:8443/container_gateway/vr1/$})

0 commit comments

Comments
 (0)