summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorMiklos Fazekas <mfazekas@szemafor.com>2018-03-11 06:34:57 +0100
committerMiklos Fazekas <mfazekas@szemafor.com>2018-03-11 06:45:56 +0100
commit17aea41081bd0c96852a4a1c1fc26f875331b3b3 (patch)
treef0d155401df1909e499a5a8d6482181d5e16931e /Rakefile
parentcfb3ac692af643cc7faa30ba3d9c3dd4caa14e9f (diff)
downloadnet-ssh-17aea41081bd0c96852a4a1c1fc26f875331b3b3.tar.gz
Updated public certv5.0.0.beta1
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile14
1 files changed, 14 insertions, 0 deletions
diff --git a/Rakefile b/Rakefile
index 5317e0a..e11ce72 100644
--- a/Rakefile
+++ b/Rakefile
@@ -43,6 +43,20 @@ RDoc::Task.new do |rdoc|
}
end
+namespace :cert do
+desc "Update public cert from private - only run if public is expired"
+task :update_public_when_expired do
+ require 'openssl'
+ require 'time'
+ raw = File.read "net-ssh-public_cert.pem"
+ certificate = OpenSSL::X509::Certificate.new raw
+ raise Exception, "Not yet expired: #{certificate.not_after}" unless certificate.not_after < Time.now
+ sh "gem cert --build netssh@solutious.com --days 365*5 --private-key /mnt/gem/net-ssh-private_key.pem"
+ sh "mv gem-public_cert.pem net-ssh-public_cert.pem"
+ sh "gem cert --add net-ssh-public_cert.pem"
+end
+end
+
namespace :rdoc do
desc "Update gh-pages branch"
task :publish do