# limitations under the License.
#
-node.default[:ssl][:certificates] = node[:ssl][:certificates] | [ "tile.openstreetmap" ]
+certificate = node[:tilecache][:ssl][:certificate]
+node.default[:ssl][:certificates] = node[:ssl][:certificates] | [ certificate ]
include_recipe "ssl"
include_recipe "squid"
nginx_site "tile-ssl" do
template "nginx_tile_ssl.conf.erb"
+ variables :certificate => certificate
+end
+
+service "nginx-certificate-restart" do
+ service_name "nginx"
+ action :nothing
+ subscribes :restart, "cookbook_file[/etc/ssl/certs/rapidssl.pem]"
+ subscribes :restart, "cookbook_file[/etc/ssl/certs/#{certificate}.pem]"
+ subscribes :restart, "file[/etc/ssl/private/#{certificate}.key]"
end
tilerenders.each do |render|
listen 443 ssl;
server_name localhost;
- ssl_certificate /etc/ssl/certs/tile.openstreetmap.pem;
- ssl_certificate_key /etc/ssl/private/tile.openstreetmap.key;
+ ssl_certificate /etc/ssl/certs/<%= @certificate %>.pem;
+ ssl_certificate_key /etc/ssl/private/<%= @certificate %>.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 SSLv3;
ssl_ciphers aRSA+HIGH:+kEDH:+kRSA:!kSRP:!kPSK:+3DES:!MD5;