stomp 1.4.0 → 1.4.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.
- checksums.yaml +7 -0
- data/CHANGELOG.md +9 -0
- data/README.md +3 -1
- data/examples/ssl_uc1.rb +4 -1
- data/examples/ssl_uc2.rb +9 -3
- data/examples/ssl_uc3.rb +10 -6
- data/examples/ssl_uc4.rb +11 -8
- data/lib/connection/netio.rb +4 -1
- data/lib/connection/utils.rb +1 -0
- data/lib/stomp/client.rb +1 -0
- data/lib/stomp/connection.rb +3 -0
- data/lib/stomp/version.rb +1 -1
- data/spec/connection_spec.rb +7 -1
- data/stomp.gemspec +11 -11
- metadata +36 -57
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d2b75bd10087d8cb1789c73298bad9b9d9451128
|
4
|
+
data.tar.gz: 627b99bc57543821f249e888580658d9b738784a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 317386822ea243835a726e445e374146e72e467006af12d15c937d458fa219d8d77140cd08b7a112afa995cdb72c98b953476d06d5790f068346c72bbfef4ef6
|
7
|
+
data.tar.gz: 38d759077e04d9b0f8a35cd9af485692770a98d87b14930f582d71bfdd02a44fdd14813b46b62b5a7cdf03264c4dcd62b08271cc58cf56061c839edda3b7c080
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# Stomp Gem Change Log
|
2
2
|
|
3
|
+
## 1.4.1 20160623
|
4
|
+
|
5
|
+
* Add call to #post_connection_check to normal SSL processing. This change
|
6
|
+
further validates the name of the broker connected to. This change adds to
|
7
|
+
the current SSL connection processing logic, and is **highly recommended**. In the
|
8
|
+
case a client cannot tolerate this logic, it can be disabled by adding
|
9
|
+
:ssl_post_conn_check => false to the connection hash.
|
10
|
+
* Fix typo in SSL failure recovery processing.
|
11
|
+
|
3
12
|
## 1.4.0 20160608
|
4
13
|
|
5
14
|
* Connection parameter :parse_timeout now means IO:select wait time for socket
|
data/README.md
CHANGED
@@ -44,6 +44,7 @@ An implementation of the Stomp protocol for Ruby. See:
|
|
44
44
|
:tcp_nodelay => true, # Turns on the TCP_NODELAY socket option; disables Nagle's algorithm
|
45
45
|
:start_timeout => 0, # Timeout around Stomp::Client initialization
|
46
46
|
:sslctx_newparm => nil, # Param for SSLContext.new
|
47
|
+
:ssl_post_conn_check => true, # Further verify broker identity
|
47
48
|
}
|
48
49
|
|
49
50
|
# for a client
|
@@ -92,6 +93,7 @@ A Stomp URL must begin with 'stomp://' and can be in one of the following forms:
|
|
92
93
|
|
93
94
|
See _CHANGELOG.rdoc_ for details.
|
94
95
|
|
96
|
+
* Gem version 1.4.1. Important SSL changes !: see CHANGELOG.md for details.
|
95
97
|
* Gem version 1.4.0. Note: Change sementics of :parse_timeout, see CHANGELOG.md for details.
|
96
98
|
* Gem version 1.3.5. Miscellaneous fixes, see CHANGELOG.rdoc for details.
|
97
99
|
* Gem version 1.3.4. Miscellaneous fixes, see CHANGELOG.rdoc for details.
|
@@ -289,7 +291,7 @@ Thiago Morello
|
|
289
291
|
2009-12-25
|
290
292
|
</td>
|
291
293
|
<td style="border: 1px solid black;padding-left: 10px;" >
|
292
|
-
(
|
294
|
+
(0362)
|
293
295
|
</td>
|
294
296
|
<td style="border: 1px solid black;padding-left: 10px;" >
|
295
297
|
<span style="font-weight: bold;" >
|
data/examples/ssl_uc1.rb
CHANGED
@@ -21,12 +21,15 @@ require "stomp"
|
|
21
21
|
class ExampleSSL1
|
22
22
|
# Initialize.
|
23
23
|
def initialize
|
24
|
+
@host = ENV['STOMP_HOST'] ? ENV['STOMP_HOST'] : "localhost"
|
25
|
+
@port = ENV['STOMP_PORT'] ? ENV['STOMP_PORT'].to_i : 61612
|
24
26
|
end
|
25
27
|
# Run example.
|
26
28
|
def run
|
29
|
+
puts "Connect host: #{@host}, port: #{@port}"
|
27
30
|
ssl_opts = Stomp::SSLParams.new
|
28
31
|
hash = { :hosts => [
|
29
|
-
{:login => 'guest', :passcode => 'guest', :host =>
|
32
|
+
{:login => 'guest', :passcode => 'guest', :host => @host, :port => @port, :ssl => ssl_opts},
|
30
33
|
],
|
31
34
|
:reliable => false, # YMMV, to test this in a sane manner
|
32
35
|
}
|
data/examples/ssl_uc2.rb
CHANGED
@@ -21,19 +21,25 @@ require "stomp"
|
|
21
21
|
class ExampleSSL2
|
22
22
|
# Initialize.
|
23
23
|
def initialize
|
24
|
+
# Change the following to the location of the cert file(s).
|
25
|
+
@cert_loc = "/ad3/gma/sslwork/2013"
|
26
|
+
@host = ENV['STOMP_HOST'] ? ENV['STOMP_HOST'] : "localhost"
|
27
|
+
@port = ENV['STOMP_PORT'] ? ENV['STOMP_PORT'].to_i : 61612
|
24
28
|
end
|
25
29
|
# Run example.
|
26
30
|
def run
|
31
|
+
puts "Connect host: #{@host}, port: #{@port}"
|
32
|
+
|
27
33
|
ts_flist = []
|
28
34
|
|
29
|
-
#
|
30
|
-
|
35
|
+
# Possibly change the cert file(s) name(s) here.
|
36
|
+
ts_flist << "#{@cert_loc}/TestCA.crt"
|
31
37
|
|
32
38
|
ssl_opts = Stomp::SSLParams.new(:ts_files => ts_flist.join(","),
|
33
39
|
:fsck => true)
|
34
40
|
#
|
35
41
|
hash = { :hosts => [
|
36
|
-
{:login => 'guest', :passcode => 'guest', :host =>
|
42
|
+
{:login => 'guest', :passcode => 'guest', :host => @host, :port => @port, :ssl => ssl_opts},
|
37
43
|
],
|
38
44
|
:reliable => false, # YMMV, to test this in a sane manner
|
39
45
|
}
|
data/examples/ssl_uc3.rb
CHANGED
@@ -23,21 +23,25 @@ require "stomp"
|
|
23
23
|
class ExampleSSL3
|
24
24
|
# Initialize.
|
25
25
|
def initialize
|
26
|
+
# Change the following to the location of the cert file(s).
|
27
|
+
@cert_loc = "/ad3/gma/sslwork/2013"
|
28
|
+
@host = ENV['STOMP_HOST'] ? ENV['STOMP_HOST'] : "localhost"
|
29
|
+
@port = ENV['STOMP_PORT'] ? ENV['STOMP_PORT'].to_i : 61612
|
26
30
|
end
|
27
31
|
# Run example.
|
28
32
|
def run
|
29
|
-
|
30
|
-
|
31
|
-
#
|
33
|
+
puts "Connect host: #{@host}, port: #{@port}"
|
34
|
+
|
35
|
+
# Possibly change the cert file(s) name(s) here.
|
32
36
|
ssl_opts = Stomp::SSLParams.new(
|
33
|
-
:key_file => "/
|
34
|
-
:cert_file => "/
|
37
|
+
:key_file => "#{@cert_loc}/client.key", # the client's private key
|
38
|
+
:cert_file => "#{@cert_loc}/client.crt", # the client's signed certificate
|
35
39
|
:fsck => true # Check that the files exist first
|
36
40
|
)
|
37
41
|
|
38
42
|
#
|
39
43
|
hash = { :hosts => [
|
40
|
-
{:login => 'guest', :passcode => 'guest', :host =>
|
44
|
+
{:login => 'guest', :passcode => 'guest', :host => @host, :port => @port, :ssl => ssl_opts},
|
41
45
|
],
|
42
46
|
:reliable => false, # YMMV, to test this in a sane manner
|
43
47
|
}
|
data/examples/ssl_uc4.rb
CHANGED
@@ -23,22 +23,25 @@ require "stomp"
|
|
23
23
|
class ExampleSSL4
|
24
24
|
# Initialize.
|
25
25
|
def initialize
|
26
|
+
# Change the following to the location of the cert file(s).
|
27
|
+
@cert_loc = "/ad3/gma/sslwork/2013"
|
28
|
+
@host = ENV['STOMP_HOST'] ? ENV['STOMP_HOST'] : "localhost"
|
29
|
+
@port = ENV['STOMP_PORT'] ? ENV['STOMP_PORT'].to_i : 61612
|
26
30
|
end
|
27
31
|
# Run example.
|
28
32
|
def run
|
29
|
-
|
30
|
-
|
31
|
-
#
|
32
|
-
# * location of the server's CA signed certificate
|
33
|
+
puts "Connect host: #{@host}, port: #{@port}"
|
34
|
+
|
35
|
+
# Possibly change the cert file(s) name(s) here.
|
33
36
|
ssl_opts = Stomp::SSLParams.new(
|
34
|
-
:key_file => "/
|
35
|
-
:cert_file => "/
|
36
|
-
:ts_files => "/
|
37
|
+
:key_file => "#{@cert_loc}/client.key", # The client's private key
|
38
|
+
:cert_file => "#{@cert_loc}/client.crt", # The client's signed certificate
|
39
|
+
:ts_files => "#{@cert_loc}/TestCA.crt", # The CA's signed sertificate
|
37
40
|
:fsck => true # Check that files exist first
|
38
41
|
)
|
39
42
|
#
|
40
43
|
hash = { :hosts => [
|
41
|
-
{:login => 'guest', :passcode => 'guest', :host =>
|
44
|
+
{:login => 'guest', :passcode => 'guest', :host => @host, :port => @port, :ssl => ssl_opts},
|
42
45
|
],
|
43
46
|
:reliable => false, # YMMV, to test this in a sane manner
|
44
47
|
}
|
data/lib/connection/netio.rb
CHANGED
@@ -347,6 +347,9 @@ module Stomp
|
|
347
347
|
ssl.hostname = @host if ssl.respond_to? :hostname=
|
348
348
|
ssl.sync_close = true # Sync ssl close with underlying TCP socket
|
349
349
|
ssl.connect
|
350
|
+
if (ssl.context.verify_mode != OpenSSL::SSL::VERIFY_NONE) && @ssl_post_conn_check
|
351
|
+
ssl.post_connection_check(@host)
|
352
|
+
end
|
350
353
|
end
|
351
354
|
def ssl.ready?
|
352
355
|
! @rbuffer.empty? || @io.ready?
|
@@ -372,7 +375,7 @@ module Stomp
|
|
372
375
|
end
|
373
376
|
#
|
374
377
|
puts ex.backtrace
|
375
|
-
$
|
378
|
+
$stdout.flush
|
376
379
|
raise # Reraise
|
377
380
|
end
|
378
381
|
end
|
data/lib/connection/utils.rb
CHANGED
data/lib/stomp/client.rb
CHANGED
@@ -56,6 +56,7 @@ module Stomp
|
|
56
56
|
# :tcp_nodelay => true, # Turns on the TCP_NODELAY socket option; disables Nagle's algorithm
|
57
57
|
# :start_timeout => 0, # Timeout around Stomp::Client initialization
|
58
58
|
# :sslctx_newparm => nil, # Param for SSLContext.new
|
59
|
+
# :ssl_post_conn_check => true, # Further verify broker identity
|
59
60
|
# }
|
60
61
|
#
|
61
62
|
# e.g. c = Stomp::Client.new(hash)
|
data/lib/stomp/connection.rb
CHANGED
@@ -93,6 +93,7 @@ module Stomp
|
|
93
93
|
# :tcp_nodelay => true, # Turns on the TCP_NODELAY socket option; disables Nagle's algorithm
|
94
94
|
# :start_timeout => 0, # Timeout around Stomp::Client initialization
|
95
95
|
# :sslctx_newparm => nil, # Param for SSLContext.new
|
96
|
+
# :ssl_post_conn_check => true, # Further verify broker identity
|
96
97
|
# }
|
97
98
|
#
|
98
99
|
# e.g. c = Stomp::Connection.new(hash)
|
@@ -146,6 +147,7 @@ module Stomp
|
|
146
147
|
@tcp_nodelay = true # Disable Nagle
|
147
148
|
@start_timeout = 0 # Client only, startup timeout
|
148
149
|
@sslctx_newparm = nil # SSLContext.new paramater
|
150
|
+
@ssl_post_conn_check = true # Additional broker verification
|
149
151
|
warn "login looks like a URL, do you have the correct parameters?" if @login =~ /:\/\//
|
150
152
|
end
|
151
153
|
|
@@ -183,6 +185,7 @@ module Stomp
|
|
183
185
|
@fast_hbs_adjust = @parameters[:fast_hbs_adjust]
|
184
186
|
@connread_timeout = @parameters[:connread_timeout]
|
185
187
|
@sslctx_newparm = @parameters[:sslctx_newparm]
|
188
|
+
@ssl_post_conn_check = @parameters[:ssl_post_conn_check]
|
186
189
|
#
|
187
190
|
# Try to support Ruby 1.9.x and 2.x ssl.
|
188
191
|
unless defined?(RSpec)
|
data/lib/stomp/version.rb
CHANGED
data/spec/connection_spec.rb
CHANGED
@@ -32,6 +32,7 @@ describe Stomp::Connection do
|
|
32
32
|
:tcp_nodelay => true,
|
33
33
|
:start_timeout => 0,
|
34
34
|
:sslctx_newparm => nil,
|
35
|
+
:ssl_post_conn_check => true,
|
35
36
|
}
|
36
37
|
|
37
38
|
#POG:
|
@@ -272,6 +273,7 @@ describe Stomp::Connection do
|
|
272
273
|
module ::OpenSSL
|
273
274
|
module SSL
|
274
275
|
VERIFY_NONE = 0
|
276
|
+
VERIFY_PEER = 1
|
275
277
|
|
276
278
|
class SSLSocket
|
277
279
|
end
|
@@ -283,14 +285,16 @@ describe Stomp::Connection do
|
|
283
285
|
end
|
284
286
|
|
285
287
|
before(:each) do
|
288
|
+
ssl_context = double(:verify_mode => OpenSSL::SSL::VERIFY_PEER)
|
286
289
|
ssl_parameters = {:hosts => [{:login => "login2", :passcode => "passcode2", :host => "remotehost", :ssl => true}]}
|
287
290
|
@ssl_socket = double(:ssl_socket, :puts => nil, :write => nil,
|
288
|
-
:setsockopt => nil, :flush => true)
|
291
|
+
:setsockopt => nil, :flush => true, :context => ssl_context)
|
289
292
|
allow(@ssl_socket).to receive(:sync_close=)
|
290
293
|
|
291
294
|
expect(TCPSocket).to receive(:open).and_return @tcp_socket
|
292
295
|
expect(OpenSSL::SSL::SSLSocket).to receive(:new).and_return(@ssl_socket)
|
293
296
|
expect(@ssl_socket).to receive(:connect)
|
297
|
+
expect(@ssl_socket).to receive(:post_connection_check)
|
294
298
|
|
295
299
|
@connection = Stomp::Connection.new ssl_parameters
|
296
300
|
end
|
@@ -363,6 +367,7 @@ describe Stomp::Connection do
|
|
363
367
|
:tcp_nodelay => true,
|
364
368
|
:start_timeout => 0,
|
365
369
|
:sslctx_newparm => nil,
|
370
|
+
:ssl_post_conn_check => true,
|
366
371
|
}
|
367
372
|
|
368
373
|
used_hash = {
|
@@ -406,6 +411,7 @@ describe Stomp::Connection do
|
|
406
411
|
:tcp_nodelay => false,
|
407
412
|
:start_timeout => 6,
|
408
413
|
:sslctx_newparm=>:TLSv1,
|
414
|
+
:ssl_post_conn_check =>false,
|
409
415
|
}
|
410
416
|
|
411
417
|
@connection = Stomp::Connection.new(used_hash)
|
data/stomp.gemspec
CHANGED
@@ -2,17 +2,19 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: stomp 1.4.1 ruby lib
|
5
6
|
|
6
7
|
Gem::Specification.new do |s|
|
7
|
-
s.name =
|
8
|
-
s.version = "1.4.
|
8
|
+
s.name = "stomp"
|
9
|
+
s.version = "1.4.1"
|
9
10
|
|
10
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib"]
|
11
13
|
s.authors = ["Brian McCallister", "Marius Mathiesen", "Thiago Morello", "Guy M. Allard"]
|
12
|
-
s.date =
|
13
|
-
s.description =
|
14
|
+
s.date = "2016-06-23"
|
15
|
+
s.description = "Ruby client for the Stomp messaging protocol. Note that this gem is no longer supported on rubyforge."
|
14
16
|
s.email = ["brianm@apache.org", "marius@stones.com", "morellon@gmail.com", "allard.guy.m@gmail.com"]
|
15
|
-
s.executables = ["
|
17
|
+
s.executables = ["catstomp", "stompcat"]
|
16
18
|
s.extra_rdoc_files = [
|
17
19
|
"LICENSE",
|
18
20
|
"README.md"
|
@@ -104,15 +106,13 @@ Gem::Specification.new do |s|
|
|
104
106
|
"test/test_urlogin.rb",
|
105
107
|
"test/tlogger.rb"
|
106
108
|
]
|
107
|
-
s.homepage =
|
109
|
+
s.homepage = "https://github.com/stompgem/stomp"
|
108
110
|
s.licenses = ["Apache-2.0"]
|
109
|
-
s.
|
110
|
-
s.
|
111
|
-
s.summary = %q{Ruby client for the Stomp messaging protocol}
|
111
|
+
s.rubygems_version = "2.2.5"
|
112
|
+
s.summary = "Ruby client for the Stomp messaging protocol"
|
112
113
|
|
113
114
|
if s.respond_to? :specification_version then
|
114
|
-
|
115
|
-
s.specification_version = 3
|
115
|
+
s.specification_version = 4
|
116
116
|
|
117
117
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
118
118
|
s.add_development_dependency(%q<rspec>, [">= 2.14.1"])
|
metadata
CHANGED
@@ -1,15 +1,9 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: stomp
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease: false
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 4
|
9
|
-
- 0
|
10
|
-
version: 1.4.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.4.1
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Brian McCallister
|
14
8
|
- Marius Mathiesen
|
15
9
|
- Thiago Morello
|
@@ -17,41 +11,37 @@ authors:
|
|
17
11
|
autorequire:
|
18
12
|
bindir: bin
|
19
13
|
cert_chain: []
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
dependencies:
|
24
|
-
- !ruby/object:Gem::Dependency
|
14
|
+
date: 2016-06-23 00:00:00.000000000 Z
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
25
17
|
name: rspec
|
26
|
-
|
27
|
-
|
28
|
-
none: false
|
29
|
-
requirements:
|
18
|
+
requirement: !ruby/object:Gem::Requirement
|
19
|
+
requirements:
|
30
20
|
- - ">="
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
hash: 53
|
33
|
-
segments:
|
34
|
-
- 2
|
35
|
-
- 14
|
36
|
-
- 1
|
21
|
+
- !ruby/object:Gem::Version
|
37
22
|
version: 2.14.1
|
38
23
|
type: :development
|
39
|
-
|
40
|
-
|
41
|
-
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 2.14.1
|
30
|
+
description: Ruby client for the Stomp messaging protocol. Note that this gem is
|
31
|
+
no longer supported on rubyforge.
|
32
|
+
email:
|
42
33
|
- brianm@apache.org
|
43
34
|
- marius@stones.com
|
44
35
|
- morellon@gmail.com
|
45
36
|
- allard.guy.m@gmail.com
|
46
|
-
executables:
|
47
|
-
- stompcat
|
37
|
+
executables:
|
48
38
|
- catstomp
|
39
|
+
- stompcat
|
49
40
|
extensions: []
|
50
|
-
|
51
|
-
extra_rdoc_files:
|
41
|
+
extra_rdoc_files:
|
52
42
|
- LICENSE
|
53
43
|
- README.md
|
54
|
-
files:
|
44
|
+
files:
|
55
45
|
- CHANGELOG.md
|
56
46
|
- LICENSE
|
57
47
|
- README.md
|
@@ -137,39 +127,28 @@ files:
|
|
137
127
|
- test/test_ssl.rb
|
138
128
|
- test/test_urlogin.rb
|
139
129
|
- test/tlogger.rb
|
140
|
-
has_rdoc: true
|
141
130
|
homepage: https://github.com/stompgem/stomp
|
142
|
-
licenses:
|
131
|
+
licenses:
|
143
132
|
- Apache-2.0
|
133
|
+
metadata: {}
|
144
134
|
post_install_message:
|
145
135
|
rdoc_options: []
|
146
|
-
|
147
|
-
require_paths:
|
136
|
+
require_paths:
|
148
137
|
- lib
|
149
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
150
|
-
|
151
|
-
requirements:
|
138
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
139
|
+
requirements:
|
152
140
|
- - ">="
|
153
|
-
- !ruby/object:Gem::Version
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
version: "0"
|
158
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
159
|
-
none: false
|
160
|
-
requirements:
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: '0'
|
143
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
144
|
+
requirements:
|
161
145
|
- - ">="
|
162
|
-
- !ruby/object:Gem::Version
|
163
|
-
|
164
|
-
segments:
|
165
|
-
- 0
|
166
|
-
version: "0"
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
version: '0'
|
167
148
|
requirements: []
|
168
|
-
|
169
149
|
rubyforge_project:
|
170
|
-
rubygems_version:
|
150
|
+
rubygems_version: 2.2.5
|
171
151
|
signing_key:
|
172
|
-
specification_version:
|
152
|
+
specification_version: 4
|
173
153
|
summary: Ruby client for the Stomp messaging protocol
|
174
154
|
test_files: []
|
175
|
-
|