puma 2.9.1 → 2.9.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of puma might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4587d687f274e6f12836cc110a0b9f69800e96a2
4
- data.tar.gz: deac8749f171c5b8a6bf10666ba748676f8e3049
3
+ metadata.gz: a3ba7fc9d6258288ee3ccd24615ee3f1cb9bb24e
4
+ data.tar.gz: 7acc27c67161d2ccb65cd8dfeabca6bbbafcdc14
5
5
  SHA512:
6
- metadata.gz: b555eb3bc18a5679d72540458a20813161cb828c9be652f861e74ca7b00be2f05f7c44594088cf6e578d8df3a96152d2fc105d68b01b5e350596fa32529bdf70
7
- data.tar.gz: f4be4cc2cc0bd2d9f880047c3547a4204995bf54a127ca72fcbfcc3f6bfb3854499701406c56515b66bcb0067caee762b44cd8eff8dbeb91dfb5564a96aa3014
6
+ metadata.gz: 21029428eda1b5b455a3e8257438211d6635da18ee17375af4ee588a0b968c8d542b86e8d3f73629926b690071c184e47db5e2af159a8ab24302be9f56aad9c4
7
+ data.tar.gz: e6e4b25b8e2aa6c8aee2ec52b274ef9af44b2fab47d99396c0cc4f207f394727d4a804348d13008e17a5db6b32e27989ce373a3f2d1af338453c0c03d05c18a4
@@ -1,3 +1,23 @@
1
+ === 2.9.2 / 1024-10-25
2
+
3
+ * 8 bug fixes:
4
+ * Fix puma-wild handling a restart properly. Fixes #550
5
+ * JRuby SSL POODLE update
6
+ * Keep deprecated features warnings
7
+ * Log the current time when Puma shuts down.
8
+ * Fix cross-platform extension library detection
9
+ * Use the correct Windows names for OpenSSL.
10
+ * Better error logging during startup
11
+ * Fixing sexist error messages
12
+
13
+ * 6 PRs merged:
14
+ * Merge pull request #549 from bsnape/log-shutdown-time
15
+ * Merge pull request #553 from lowjoel/master
16
+ * Merge pull request #568 from mariuz/patch-1
17
+ * Merge pull request #578 from danielbuechele/patch-1
18
+ * Merge pull request #581 from alexch/slightly-better-logging
19
+ * Merge pull request #590 from looker/jruby_disable_sslv3
20
+
1
21
  === 2.9.1 / 2014-09-05
2
22
 
3
23
  * 4 bug fixes:
data/README.md CHANGED
@@ -248,4 +248,4 @@ $ bundle exec rake
248
248
 
249
249
  ## License
250
250
 
251
- Puma is copyright 2013 Evan Phoenix and contributors. It is licensed under the BSD 3-Clause license. See the include LICENSE file for details.
251
+ Puma is copyright 2014 Evan Phoenix and contributors. It is licensed under the BSD 3-Clause license. See the include LICENSE file for details.
@@ -5,11 +5,25 @@
5
5
 
6
6
  require 'rubygems'
7
7
 
8
- deps = ARGV.shift.split(",").each do |s|
8
+ gems = ARGV.shift
9
+
10
+ inc = ""
11
+
12
+ if gems == "-I"
13
+ inc = ARGV.shift
14
+ $LOAD_PATH.concat inc.split(":")
15
+ gems = ARGV.shift
16
+ end
17
+
18
+ gems.split(",").each do |s|
9
19
  name, ver = s.split(":",2)
10
20
  gem name, ver
11
21
  end
12
22
 
23
+ module Puma; end
24
+
25
+ Puma.const_set("WILD_ARGS", ["-I", inc, gems])
26
+
13
27
  require 'puma/cli'
14
28
 
15
29
  cli = Puma::CLI.new ARGV
@@ -2,7 +2,8 @@ require 'mkmf'
2
2
 
3
3
  dir_config("puma_http11")
4
4
 
5
- $defs.push "-Wno-deprecated-declarations"
6
- $libs += " -lssl -lcrypto "
5
+ if %w'ssl ssleay32'.find {|ssl| have_library(ssl, 'SSL_CTX_new')} and
6
+ %w'crypto libeay32'.find {|crypto| have_library(crypto, 'BIO_read')}
7
7
 
8
- create_makefile("puma/puma_http11")
8
+ create_makefile("puma/puma_http11")
9
+ end
@@ -1,6 +1,7 @@
1
1
  package org.jruby.puma;
2
2
 
3
3
  import org.jruby.Ruby;
4
+ import org.jruby.RubyBoolean;
4
5
  import org.jruby.RubyClass;
5
6
  import org.jruby.RubyModule;
6
7
  import org.jruby.RubyObject;
@@ -151,6 +152,15 @@ public class MiniSSL extends RubyObject {
151
152
 
152
153
  sslCtx.init(kmf.getKeyManagers(), null, null);
153
154
  engine = sslCtx.createSSLEngine();
155
+
156
+ IRubyObject enableSSLv3 = miniSSLContext.callMethod(threadContext, "enable_SSLv3");
157
+ String[] protocols;
158
+ if (enableSSLv3 instanceof RubyBoolean && enableSSLv3.isTrue()) {
159
+ protocols = new String[] { "SSLv2Hello", "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2" };
160
+ } else {
161
+ protocols = new String[] { "TLSv1", "TLSv1.1", "TLSv1.2" };
162
+ }
163
+ engine.setEnabledProtocols(protocols);
154
164
  engine.setUseClientMode(false);
155
165
 
156
166
  SSLSession session = engine.getSession();
@@ -322,6 +322,7 @@ module Puma
322
322
 
323
323
  def graceful_stop
324
324
  @runner.stop_blocked
325
+ log "=== puma shutdown: #{Time.now} ==="
325
326
  log "- Goodbye!"
326
327
  end
327
328
 
@@ -362,7 +363,11 @@ module Puma
362
363
  lib = File.expand_path "lib"
363
364
  arg0[1,0] = ["-I", lib] if $:[0] == lib
364
365
 
365
- @restart_argv = arg0 + ARGV
366
+ if defined? Puma::WILD_ARGS
367
+ @restart_argv = arg0 + Puma::WILD_ARGS + ARGV
368
+ else
369
+ @restart_argv = arg0 + ARGV
370
+ end
366
371
  end
367
372
  end
368
373
 
@@ -430,6 +435,7 @@ module Puma
430
435
  Dir.chdir @restart_dir
431
436
 
432
437
  argv += [redirects] unless RUBY_VERSION < '1.9'
438
+
433
439
  Kernel.exec(*argv)
434
440
  end
435
441
  end
@@ -466,8 +472,9 @@ module Puma
466
472
 
467
473
  wild = File.expand_path(File.join(puma_lib_dir, "../bin/puma-wild"))
468
474
 
469
- args = [Gem.ruby] + dirs.map { |x| ["-I", x] }.flatten +
470
- [wild, deps] + @original_argv
475
+ wild_loadpath = dirs.join(":")
476
+
477
+ args = [Gem.ruby] + [wild, "-I", wild_loadpath, deps] + @original_argv
471
478
 
472
479
  Kernel.exec(*args)
473
480
  end
@@ -28,7 +28,7 @@ module Puma
28
28
  # too taxing on performance.
29
29
  module Const
30
30
 
31
- PUMA_VERSION = VERSION = "2.9.1".freeze
31
+ PUMA_VERSION = VERSION = "2.9.2".freeze
32
32
  CODE_NAME = "Team High Five".freeze
33
33
 
34
34
  FAST_TRACK_KA_TIMEOUT = 0.2
@@ -95,6 +95,11 @@ module Puma
95
95
  # jruby-specific Context properties: java uses a keystore and password pair rather than a cert/key pair
96
96
  attr_reader :keystore
97
97
  attr_accessor :keystore_pass
98
+ attr_accessor :enable_SSLv3
99
+
100
+ def initialize
101
+ @enable_SSLv3 = false
102
+ end
98
103
 
99
104
  def keystore=(keystore)
100
105
  raise ArgumentError, "No such keystore file '#{keystore}'" unless File.exist? keystore
@@ -112,7 +112,7 @@ module Puma
112
112
  begin
113
113
  @app = @cli.config.app
114
114
  rescue Exception => e
115
- log "! Unable to load application"
115
+ log "! Unable to load application: #{e.class}: #{e.message}"
116
116
  raise e
117
117
  end
118
118
 
@@ -714,7 +714,7 @@ module Puma
714
714
  if @leak_stack_on_error
715
715
  [500, {}, ["Puma caught this error: #{e.message} (#{e.class})\n#{e.backtrace.join("\n")}"]]
716
716
  else
717
- [500, {}, ["A really lowlevel plumbing error occured. Please contact your local Maytag(tm) repair man.\n"]]
717
+ [500, {}, ["A really lowlevel plumbing error occured. Please contact your local Maytag(tm) repair person.\n"]]
718
718
  end
719
719
  end
720
720
 
@@ -16,21 +16,21 @@ class TestPumaServerSSL < Test::Unit::TestCase
16
16
 
17
17
  @app = lambda { |env| [200, {}, [env['rack.url_scheme']]] }
18
18
 
19
- ctx = Puma::MiniSSL::Context.new
19
+ @ctx = Puma::MiniSSL::Context.new
20
20
 
21
21
  if defined?(JRUBY_VERSION)
22
- ctx.keystore = File.expand_path "../../examples/puma/keystore.jks", __FILE__
23
- ctx.keystore_pass = 'blahblah'
22
+ @ctx.keystore = File.expand_path "../../examples/puma/keystore.jks", __FILE__
23
+ @ctx.keystore_pass = 'blahblah'
24
24
  else
25
- ctx.key = File.expand_path "../../examples/puma/puma_keypair.pem", __FILE__
26
- ctx.cert = File.expand_path "../../examples/puma/cert_puma.pem", __FILE__
25
+ @ctx.key = File.expand_path "../../examples/puma/puma_keypair.pem", __FILE__
26
+ @ctx.cert = File.expand_path "../../examples/puma/cert_puma.pem", __FILE__
27
27
  end
28
28
 
29
- ctx.verify_mode = Puma::MiniSSL::VERIFY_NONE
29
+ @ctx.verify_mode = Puma::MiniSSL::VERIFY_NONE
30
30
 
31
31
  @events = Puma::Events.new STDOUT, STDERR
32
32
  @server = Puma::Server.new @app, @events
33
- @server.add_ssl_listener @host, @port, ctx
33
+ @server.add_ssl_listener @host, @port, @ctx
34
34
  @server.run
35
35
 
36
36
  @http = Net::HTTP.new @host, @port
@@ -88,4 +88,50 @@ class TestPumaServerSSL < Test::Unit::TestCase
88
88
  assert_equal "https", body
89
89
  end
90
90
 
91
+ if defined?(JRUBY_VERSION)
92
+ def test_ssl_v3_support_disabled_by_default
93
+ @http.ssl_version='SSLv3'
94
+ assert_raises(OpenSSL::SSL::SSLError) do
95
+ @http.start do
96
+ Net::HTTP::Get.new '/'
97
+ end
98
+ end
99
+ end
100
+
101
+ def test_enabling_ssl_v3_support
102
+ @server.stop(true)
103
+ @ctx.enable_SSLv3 = true
104
+ @server = Puma::Server.new @app, @events
105
+ @server.add_ssl_listener @host, @port, @ctx
106
+ @server.run
107
+ @http.ssl_version='SSLv3'
108
+
109
+ body = nil
110
+ @http.start do
111
+ req = Net::HTTP::Get.new "/", {}
112
+
113
+ @http.request(req) do |rep|
114
+ body = rep.body
115
+ end
116
+ end
117
+
118
+ assert_equal "https", body
119
+ end
120
+
121
+ def test_enabling_ssl_v3_support_requires_true
122
+ @server.stop(true)
123
+ @ctx.enable_SSLv3 = "truthy but not true"
124
+ @server = Puma::Server.new @app, @events
125
+ @server.add_ssl_listener @host, @port, @ctx
126
+ @server.run
127
+ @http.ssl_version='SSLv3'
128
+
129
+ assert_raises(OpenSSL::SSL::SSLError) do
130
+ @http.start do
131
+ Net::HTTP::Get.new '/'
132
+ end
133
+ end
134
+ end
135
+ end
136
+
91
137
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puma
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.1
4
+ version: 2.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Phoenix
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-05 00:00:00.000000000 Z
11
+ date: 2014-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -64,14 +64,14 @@ dependencies:
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '3.12'
67
+ version: '3.13'
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: '3.12'
74
+ version: '3.13'
75
75
  description: Puma is a simple, fast, threaded, and highly concurrent HTTP 1.1 server
76
76
  for Ruby/Rack applications. Puma is intended for use in both development and production
77
77
  environments. In order to get the best throughput, it is highly recommended that