summaryrefslogtreecommitdiff
path: root/sample
diff options
context:
space:
mode:
authornahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-01-29 13:30:05 +0000
committernahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-01-29 13:30:05 +0000
commitd52c3b1e94739f690d90277278794a2e7174eef2 (patch)
tree033b0a0144cb03c273d57ef4abc44a1751251db3 /sample
parent04b5228aba6e9aaaf3c082cb2aeafa124fcaca3b (diff)
downloadruby-d52c3b1e94739f690d90277278794a2e7174eef2.tar.gz
* sample/openssl/gen_csr.rb: follow OpenSSL::X509::Name change.
ASN.1 type of subject DN elements were wrong. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample')
-rw-r--r--sample/openssl/gen_csr.rb10
1 files changed, 3 insertions, 7 deletions
diff --git a/sample/openssl/gen_csr.rb b/sample/openssl/gen_csr.rb
index 5d6a6542ab..7c7f559995 100644
--- a/sample/openssl/gen_csr.rb
+++ b/sample/openssl/gen_csr.rb
@@ -19,13 +19,9 @@ keypair_file = $OPT_key
csrout = $OPT_csrout || "csr.pem"
keyout = $OPT_keyout || "keypair.pem"
-name_str = ARGV.shift or usage()
-
$stdout.sync = true
-
-name_ary = name_str.scan(/\s*([^\/,]+)\s*/).collect { |i| i[0].split("=") }
-p name_ary
-name = X509::Name.new(name_ary, OpenSSL::ASN1::PRINTABLESTRING)
+name_str = ARGV.shift or usage()
+name = X509::Name.parse(name_str)
keypair = nil
if keypair_file
@@ -39,7 +35,7 @@ else
end
end
-puts "Generating CSR for #{name_ary.inspect}"
+puts "Generating CSR for #{name_str}"
req = X509::Request.new
req.version = 0