Skip to content

Commit

Permalink
horizon: Correct SAN in SSL certs (SOC-10584)
Browse files Browse the repository at this point in the history
The gensslcert script from apache-utils didn't support setting SAN values.
This resulted in useless certificate which had SAN set to
email:webmaster@... or (in new version) FQDN of the node where horizon
was deployed. After adding new option to gensslcert, crowbar can set SAN
to proper values which is especially important in HA deployments.
  • Loading branch information
skazi0 committed Sep 4, 2020
1 parent 49cb640 commit 101e095
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion chef/cookbooks/horizon/recipes/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -517,9 +517,14 @@
if node[:horizon][:apache][:ssl] && node[:horizon][:apache][:generate_certs]
package "apache2-utils"

san_domains = []
san_domains.push(CrowbarHelper.get_host_for_public_url(node, true, ha_enabled))
san_domains.push(CrowbarHelper.get_host_for_admin_url(node, ha_enabled))
san = san_domains.map { |d| "DNS:#{d}" }.join(",")

bash "Generate Apache certificate" do
code <<-EOH
(umask 377 ; /usr/bin/gensslcert -C openstack-dashboard -n openstack-dashboard)
(umask 377 ; /usr/bin/gensslcert -C openstack-dashboard -n openstack-dashboard -a "#{san}")
EOH
only_if do
!File.size?(node[:horizon][:apache][:ssl_crt_file]) && (
Expand Down

0 comments on commit 101e095

Please sign in to comment.