jruby-openssl 0.7 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.txt CHANGED
@@ -1,3 +1,22 @@
1
+ == 0.7.1
2
+
3
+ - NOTE: Now BouncyCastle jars has moved out to its own gem
4
+ "bouncy-castle-java" (http://rubygems.org/gems/bouncy-castle-java).
5
+ You don't need to care about it because "jruby-openssl" gem depends
6
+ on it from now on.
7
+
8
+ === SSL bugfix
9
+
10
+ - JRUBY-4826 net/https client possibly raises "rbuf_fill': End of file
11
+ reached (EOFError)" for HTTP chunked read.
12
+
13
+ === Misc
14
+
15
+ - JRUBY-4900: Set proper String to OpenSSL::OPENSSL_VERSION. Make sure
16
+ it's not an OpenSSL artifact: "OpenSSL 0.9.8b 04 May 2006
17
+ (JRuby-OpenSSL fake)" -> "jruby-ossl 0.7.1"
18
+ - JRUBY-4975: Moving BouncyCastle jars out to its own gem.
19
+
1
20
  == 0.7
2
21
 
3
22
  - Follow MRI 1.8.7 openssl API changes
data/Manifest.txt CHANGED
@@ -4,8 +4,6 @@ Manifest.txt
4
4
  README.txt
5
5
  License.txt
6
6
  lib/jopenssl.jar
7
- lib/bcmail-jdk15-144.jar
8
- lib/bcprov-jdk15-144.jar
9
7
  lib/jopenssl
10
8
  lib/jopenssl.jar
11
9
  lib/openssl
@@ -34,6 +32,7 @@ test/test_openssl.rb
34
32
  test/test_parse_certificate.rb
35
33
  test/test_pkcs7.rb
36
34
  test/test_pkey.rb
35
+ test/test_ssl.rb
37
36
  test/test_x509store.rb
38
37
  test/ut_eof.rb
39
38
  test/fixture/ca-bundle.crt
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rake'
2
2
  require 'rake/testtask'
3
3
 
4
4
  MANIFEST = FileList["Rakefile", "History.txt", "Manifest.txt", "README.txt", "License.txt", "lib/jopenssl.jar", "lib/**/*", "test/**/*"]
5
- BC_JARS = FileList["lib/bc*.jar"]
5
+ BC_JARS = FileList["build_lib/bc*.jar"]
6
6
 
7
7
  task :default => [:java_compile, :test]
8
8
 
@@ -38,8 +38,7 @@ task :java_compile do
38
38
  end
39
39
 
40
40
  sh "javac @pkg/compile_options @pkg/compile_classpath @pkg/compile_sourcefiles"
41
- File.open("pkg/classes/manifest.mf", "w") {|f| f.puts "Class-Path: #{BC_JARS.map{|f| File.basename(f) }.join(' ')}"}
42
- sh "jar cfm lib/jopenssl.jar pkg/classes/manifest.mf -C pkg/classes/ ."
41
+ sh "jar cf lib/jopenssl.jar -C pkg/classes/ ."
43
42
  end
44
43
  file "lib/jopenssl.jar" => :java_compile
45
44
 
@@ -64,6 +63,7 @@ begin
64
63
  p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
65
64
  p.description = p.paragraphs_of('README.txt', 3...4).join("\n\n")
66
65
  p.test_globs = ENV["TEST"] || ["test/test_all.rb"]
66
+ p.extra_deps << ['bouncy-castle-java', '>= 0']
67
67
  end
68
68
  hoe.spec.dependencies.delete_if { |dep| dep.name == "hoe" }
69
69
 
@@ -1,5 +1,5 @@
1
1
  module Jopenssl
2
2
  module Version
3
- VERSION = "0.7"
3
+ VERSION = "0.7.1"
4
4
  end
5
5
  end
data/lib/jopenssl.jar CHANGED
Binary file
data/lib/openssl/dummy.rb CHANGED
@@ -1,6 +1,5 @@
1
- warn "Warning: OpenSSL ASN1/PKey/X509/Netscape/PKCS7 implementation unavailable"
2
- warn "You need to download or install BouncyCastle jars (bc-prov-*.jar, bc-mail-*.jar)"
3
- warn "to fix this."
1
+ warn "OpenSSL ASN1/PKey/X509/Netscape/PKCS7 implementation unavailable"
2
+ warn "gem install bouncy-castle-java for full support."
4
3
  module OpenSSL
5
4
  module ASN1
6
5
  class ASN1Error < OpenSSLError; end
data/lib/openssl.rb CHANGED
@@ -58,8 +58,14 @@ unless defined?(::Digest::Class)
58
58
  end
59
59
  # end of compat chunk.
60
60
 
61
+ begin
62
+ require 'bouncy-castle-java'
63
+ rescue LoadError
64
+ # runs under restricted mode.
65
+ end
61
66
  require 'jopenssl'
62
67
 
68
+
63
69
  require 'openssl/bn'
64
70
  require 'openssl/cipher'
65
71
  require 'openssl/digest'
data/test/test_java.rb CHANGED
@@ -6,7 +6,7 @@ require 'mocha'
6
6
  if defined?(JRUBY_VERSION)
7
7
  require "java"
8
8
  $CLASSPATH << 'pkg/classes'
9
- $CLASSPATH << 'lib/bcprov-jdk15-144.jar'
9
+ $CLASSPATH << 'build_lib/bcprov-jdk15-144.jar'
10
10
 
11
11
  module PKCS7Test
12
12
  module ASN1
data/test/test_ssl.rb ADDED
@@ -0,0 +1,97 @@
1
+ require 'openssl'
2
+ require 'test/unit'
3
+ require 'webrick/https'
4
+ require 'net/https'
5
+ require 'logger'
6
+ require File.expand_path('openssl/utils', File.dirname(__FILE__))
7
+
8
+
9
+ class TestSSL < Test::Unit::TestCase
10
+ PORT = 17171
11
+ DIR = File.dirname(File.expand_path(__FILE__))
12
+
13
+ def setup
14
+ @server = @server_thread = nil
15
+ @verbose, $VERBOSE = $VERBOSE, nil
16
+ setup_server
17
+ end
18
+
19
+ def teardown
20
+ $VERBOSE = @verbose
21
+ teardown_server
22
+ end
23
+
24
+ def test_jruby_4826
25
+ assert_nothing_raised do
26
+ 100.times do
27
+ http = Net::HTTP.new('localhost', PORT)
28
+ http.use_ssl = true
29
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
30
+ req = Net::HTTP::Post.new('/post')
31
+ http.request(req).body
32
+ end
33
+ end
34
+ end
35
+
36
+ private
37
+
38
+ def make_certificate(key, cn)
39
+ subject = OpenSSL::X509::Name.parse("/DC=org/DC=ruby-lang/CN=#{cn}")
40
+ exts = [
41
+ ["keyUsage", "keyEncipherment,digitalSignature", true],
42
+ ]
43
+ OpenSSL::TestUtils.issue_cert(
44
+ subject, key, 1, Time.now, Time.now + 3600, exts,
45
+ nil, nil, OpenSSL::Digest::SHA1.new
46
+ )
47
+ end
48
+
49
+ def setup_server
50
+ key = OpenSSL::TestUtils::TEST_KEY_RSA1024
51
+ cert = make_certificate(key, "localhost")
52
+ logger = Logger.new(STDERR)
53
+ logger.level = Logger::Severity::FATAL # avoid logging SSLError (ERROR level)
54
+ @server = WEBrick::HTTPServer.new(
55
+ :Logger => logger,
56
+ :Port => PORT,
57
+ :AccessLog => [],
58
+ :SSLEnable => true,
59
+ :ServerName => "localhost",
60
+ :SSLCertificate => cert,
61
+ :SSLPrivateKey => key
62
+ )
63
+ @server.mount(
64
+ "/post",
65
+ WEBrick::HTTPServlet::ProcHandler.new(method("do_post").to_proc)
66
+ )
67
+ @server_thread = start_server_thread(@server)
68
+ end
69
+
70
+ def do_post(req, res)
71
+ res.chunked = true
72
+ res['content-type'] = 'text/plain'
73
+ piper, pipew = IO.pipe
74
+ res.body = piper
75
+ 10.times { pipew << "A" * 10 }
76
+ pipew.close
77
+ end
78
+
79
+ def start_server_thread(server)
80
+ t = Thread.new {
81
+ Thread.current.abort_on_exception = true
82
+ server.start
83
+ }
84
+ while server.status != :Running
85
+ Thread.pass
86
+ unless t.alive?
87
+ t.join
88
+ raise
89
+ end
90
+ end
91
+ t
92
+ end
93
+
94
+ def teardown_server
95
+ @server.shutdown if @server
96
+ end
97
+ end
metadata CHANGED
@@ -5,7 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 7
8
- version: "0.7"
8
+ - 1
9
+ version: 0.7.1
9
10
  platform: ruby
10
11
  authors:
11
12
  - Ola Bini and JRuby contributors
@@ -13,10 +14,37 @@ autorequire:
13
14
  bindir: bin
14
15
  cert_chain: []
15
16
 
16
- date: 2010-04-27 00:00:00 -05:00
17
+ date: 2010-08-03 00:00:00 -05:00
17
18
  default_executable:
18
- dependencies: []
19
-
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: bouncy-castle-java
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ segments:
29
+ - 0
30
+ version: "0"
31
+ type: :runtime
32
+ version_requirements: *id001
33
+ - !ruby/object:Gem::Dependency
34
+ name: rubyforge
35
+ prerelease: false
36
+ requirement: &id002 !ruby/object:Gem::Requirement
37
+ none: false
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ segments:
42
+ - 2
43
+ - 0
44
+ - 4
45
+ version: 2.0.4
46
+ type: :development
47
+ version_requirements: *id002
20
48
  description: JRuby-OpenSSL is an add-on gem for JRuby that emulates the Ruby OpenSSL native library.
21
49
  email: ola.bini@gmail.com
22
50
  executables: []
@@ -35,8 +63,6 @@ files:
35
63
  - README.txt
36
64
  - License.txt
37
65
  - lib/jopenssl.jar
38
- - lib/bcmail-jdk15-144.jar
39
- - lib/bcprov-jdk15-144.jar
40
66
  - lib/openssl.rb
41
67
  - lib/jopenssl/version.rb
42
68
  - lib/openssl/bn.rb
@@ -58,6 +84,7 @@ files:
58
84
  - test/test_parse_certificate.rb
59
85
  - test/test_pkcs7.rb
60
86
  - test/test_pkey.rb
87
+ - test/test_ssl.rb
61
88
  - test/test_x509store.rb
62
89
  - test/ut_eof.rb
63
90
  - test/fixture/ca-bundle.crt
@@ -133,6 +160,7 @@ rdoc_options:
133
160
  require_paths:
134
161
  - lib
135
162
  required_ruby_version: !ruby/object:Gem::Requirement
163
+ none: false
136
164
  requirements:
137
165
  - - ">="
138
166
  - !ruby/object:Gem::Version
@@ -140,6 +168,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
140
168
  - 0
141
169
  version: "0"
142
170
  required_rubygems_version: !ruby/object:Gem::Requirement
171
+ none: false
143
172
  requirements:
144
173
  - - ">="
145
174
  - !ruby/object:Gem::Version
@@ -149,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
178
  requirements: []
150
179
 
151
180
  rubyforge_project: jruby-extras
152
- rubygems_version: 1.3.6
181
+ rubygems_version: 1.3.7
153
182
  signing_key:
154
183
  specification_version: 3
155
184
  summary: OpenSSL add-on for JRuby
Binary file
Binary file