10000 Incorporate OpenSSL tests from JRuby. by headius · Pull Request #206 · ruby/ruby · GitHub
[go: up one dir, main page]

Skip to content

Incorporate OpenSSL tests from JRuby. #206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add test for constructing certificate from an open File.
  • Loading branch information
headius committed Oct 31, 2012
commit d04b47bf5608495f8b4ec49f250597c54be54349
14 changes: 14 additions & 0 deletions test/openssl/test_certificate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,18 @@ def test_ids_in_subject_rdn_set
assert_equal(10, keys.size)
assert_equal(true, keys.include?("CN"))
end

# jruby/jruby#152
def test_cert_init_from_file
cert_file = File.expand_path('fixture/ca-bundle.crt', File.dirname(__FILE__))
cert = OpenSSL::X509::Certificate.new(File.open(cert_file))

expected = [["C", "US", 19],
["ST", "DC", 19],
["L", "Washington", 19],
["O", "ABA.ECOM, INC.", 19],
["CN", "ABA.ECOM Root CA", 19]]

assert_equal expected, cert.subject.to_a[0..4]
end
end
0