Skip to content

Commit 5c9a490

Browse files
committed
Can now supply the domain to create the cert for
1 parent 16daf46 commit 5c9a490

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/tasks/cuttlefish.rake

+5-2
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,13 @@ namespace :cuttlefish do
8888
end
8989

9090
# Little "proof of concept" of generating an SSL certificate
91-
task create_ssl_certificate: :environment do
91+
desc "Create SSL certificate (proof of concept)"
92+
task :create_ssl_certificate, [:domain] => :environment do |_t, args|
9293
require "openssl"
9394

95+
domain = args[:domain]
96+
puts "Generating certificate for #{domain}..."
97+
9498
directory = "/etc/cuttlefish-ssl/keys"
9599
filename = File.join(directory, "key.pem")
96100
private_key = OpenSSL::PKey::RSA.new(
@@ -114,7 +118,6 @@ namespace :cuttlefish do
114118
File.write(filename, private_key.export)
115119
end
116120

117-
domain = "f553-2403-5806-d1d-0-eabd-d4ca-101c-d367.ngrok.io"
118121
order = client.new_order(identifiers: [domain])
119122
authorization = order.authorizations.first
120123
challenge = authorization.http

0 commit comments

Comments
 (0)