mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
certs stay in pem, openssl cannot do der for chained certs
This commit is contained in:
parent
060376acfe
commit
5a5845e890
1 changed files with 8 additions and 3 deletions
11
Rakefile
11
Rakefile
|
@ -118,11 +118,16 @@ task :compile_nginx_mapfiles => [:environment] do
|
|||
|
||||
sites.each do |site|
|
||||
[site[:domain], "www.#{site[:domain]}"].each do |domain|
|
||||
key = OpenSSL::PKey::RSA.new site[:ssl_key]
|
||||
crt = OpenSSL::X509::Certificate.new site[:ssl_cert]
|
||||
begin
|
||||
key = OpenSSL::PKey::RSA.new site[:ssl_key]
|
||||
crt = OpenSSL::X509::Certificate.new site[:ssl_cert]
|
||||
rescue => e
|
||||
puts "SSL ERROR: #{e.class} #{e.inspect}"
|
||||
next
|
||||
end
|
||||
|
||||
File.open(File.join(ssl_path, "#{domain}.key"), 'wb') {|f| f.write key.to_der}
|
||||
File.open(File.join(ssl_path, "#{domain}.crt"), 'wb') {|f| f.write crt.to_der}
|
||||
File.open(File.join(ssl_path, "#{domain}.crt"), 'wb') {|f| f.write site[:ssl_cert]}
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue