summaryrefslogtreecommitdiff
path: root/sample/openssl/gen_csr.rb
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2021-02-25 16:55:40 +0900
committerKazuki Yamaguchi <k@rhe.jp>2021-03-16 19:37:06 +0900
commit7f0b3fb9060b75b4f15b8e7e5866d2c13c132c29 (patch)
treec1d45b5d6727f72840c9ae9cd371cce61738bc1d /sample/openssl/gen_csr.rb
parente35d3623de47b1a8d699f431460fbcba36de84f2 (diff)
[ruby/openssl] sample: update obsolete API use
https://github.com/ruby/openssl/commit/dafa851c0d
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4275
Diffstat (limited to 'sample/openssl/gen_csr.rb')
-rw-r--r--sample/openssl/gen_csr.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/sample/openssl/gen_csr.rb b/sample/openssl/gen_csr.rb
index baac9905be..34b23fec1c 100644
--- a/sample/openssl/gen_csr.rb
+++ b/sample/openssl/gen_csr.rb
@@ -25,7 +25,7 @@ keypair = nil
if keypair_file
keypair = OpenSSL::PKey.read(File.read(keypair_file))
else
- keypair = OpenSSL::PKey::RSA.new(1024) { putc "." }
+ keypair = OpenSSL::PKey::RSA.new(2048) { putc "." }
puts
puts "Writing #{keyout}..."
File.open(keyout, "w", 0400) do |f|
@@ -38,8 +38,8 @@ puts "Generating CSR for #{name_str}"
req = OpenSSL::X509::Request.new
req.version = 0
req.subject = name
-req.public_key = keypair.public_key
-req.sign(keypair, Digest.new('MD5'))
+req.public_key = keypair
+req.sign(keypair, "MD5")
puts "Writing #{csrout}..."
File.open(csrout, "w") do |f|