diff options
author | elijah <elijah@riseup.net> | 2016-01-31 15:07:18 -0800 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2016-01-31 15:07:18 -0800 |
commit | 16fb1c2bf33ca418a6db06217e286964077a730f (patch) | |
tree | f522ddae365d87815916f6108bf2514961237589 /vendor/gems/certificate_authority/lib/tasks | |
parent | 684a790cdb9575da522e402d0c9289f4a8558739 (diff) |
vendor certificate_authority, because travis does not like pulling it from github.
Diffstat (limited to 'vendor/gems/certificate_authority/lib/tasks')
-rw-r--r-- | vendor/gems/certificate_authority/lib/tasks/certificate_authority.rake | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/vendor/gems/certificate_authority/lib/tasks/certificate_authority.rake b/vendor/gems/certificate_authority/lib/tasks/certificate_authority.rake new file mode 100644 index 0000000..e7d5bf9 --- /dev/null +++ b/vendor/gems/certificate_authority/lib/tasks/certificate_authority.rake @@ -0,0 +1,23 @@ +require 'certificate_authority' + +namespace :certificate_authority do + desc "Generate a quick self-signed cert" + task :self_signed do + + cn = "http://localhost" + cn = ENV['DOMAIN'] unless ENV['DOMAIN'].nil? + + root = CertificateAuthority::Certificate.new + root.subject.common_name= cn + root.key_material.generate_key + root.signing_entity = true + root.valid? + root.sign! + + print "Your cert for #{cn}\n" + print root.to_pem + + print "Your private key\n" + print root.key_material.private_key.to_pem + end +end |