logstash-input-http 3.2.1-java → 3.2.2-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fb71407dd95cdf4ed3a00e3a3052eb9ca98228aab5c4b0d5d850fab30f398612
4
- data.tar.gz: 606cb730cbef12485216a22c367fe7e07c0f1f12b4e7e3d2227cb6ef32012a9e
3
+ metadata.gz: 4ff21efab29549806ebbdb005b2cd9f6d91a69a2aa1558e2ceb48e78d867e426
4
+ data.tar.gz: 37bbbf9e61f85a24b79030a3d5f8d5b90083fa6f916aa6bd1bde1b47db7561f6
5
5
  SHA512:
6
- metadata.gz: 77dda823940c35650a14743778fda13e12abbfad0b718d386b410598dc187ee7aa6f0b08a665d95dfc507237c9d0f5ef878ec92394cf4a91e87544860da83da1
7
- data.tar.gz: add1951942163b0908a6b0288f0945bc3a412e2eff9bd0819ef988b972031a9211304a4c58475ef04ee062f93cc649a7afcfe0fe352b82eb28792bffd5fdb2d1
6
+ metadata.gz: b9d443f81399d5bfc1481f1d9db071a469c9d8ed1e565469d3dd91a4e3c4806d4ceb62a8bce70ea886324641b832e7ba59cbe3125f224a0536c143c99af5582c
7
+ data.tar.gz: ba1d68ce3df79043e6af91c34fc84f9311e35b6781aac188c2f9640bdd068bfd4fadebea81864849f33ad64eae07f56ea1af7a5697d60af40d55500ddcdf89ab
@@ -1,3 +1,6 @@
1
+ ## 3.2.2
2
+ - Fix some edge cases of the verify\_mode+ssl\_verify\_mode options
3
+
1
4
  ## 3.2.1
2
5
  - Fix expensive SslContext creation per connection #93
3
6
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.2.1
1
+ 3.2.2
@@ -4,4 +4,4 @@ require 'jar_dependencies'
4
4
  require_jar('io.netty', 'netty-all', '4.1.18.Final')
5
5
  require_jar('io.netty', 'netty-tcnative-boringssl-static', '2.0.7.Final')
6
6
  require_jar('org.apache.logging.log4j', 'log4j-api', '2.6.2')
7
- require_jar('org.logstash.plugins.input.http', 'logstash-input-http', '3.2.1')
7
+ require_jar('org.logstash.plugins.input.http', 'logstash-input-http', '3.2.2')
@@ -191,10 +191,14 @@ class LogStash::Inputs::Http < LogStash::Inputs::Base
191
191
  raise LogStash::ConfigurationError, "Certificate or JKS must be configured"
192
192
  end
193
193
 
194
- if @ssl && original_params.key?("verify_mode")
195
- if original_params.key?("ssl_verify_mode")
194
+ if @ssl && (original_params.key?("verify_mode") && original_params.key?("ssl_verify_mode"))
196
195
  raise LogStash::ConfigurationError, "Both 'ssl_verify_mode' and 'verify_mode' were set. Use only 'ssl_verify_mode'."
197
- end
196
+ elsif original_params.key?("verify_mode")
197
+ @ssl_verify_mode_final = @verify_mode
198
+ elsif original_params.key?("ssl_verify_mode")
199
+ @ssl_verify_mode_final = @ssl_verify_mode
200
+ else
201
+ @ssl_verify_mode_final = @ssl_verify_mode
198
202
  end
199
203
 
200
204
  if @ssl && require_certificate_authorities? && !client_authentication?
@@ -213,11 +217,9 @@ class LogStash::Inputs::Http < LogStash::Inputs::Base
213
217
  return nil unless @ssl
214
218
 
215
219
  ssl_builder = nil
216
- verify_mode_string = nil
217
220
 
218
221
  if @keystore && @keystore_password
219
222
  ssl_builder = org.logstash.plugins.inputs.http.util.JksSslBuilder.new(@keystore, @keystore_password.value)
220
- verify_mode_string = @verify_mode.upcase if original_params.key?("verify_mode")
221
223
  else
222
224
  begin
223
225
  ssl_builder = org.logstash.plugins.inputs.http.util.SslSimpleBuilder.new(@ssl_certificate, @ssl_key, @ssl_key_passphrase.nil? ? nil : @ssl_key_passphrase.value)
@@ -227,14 +229,13 @@ class LogStash::Inputs::Http < LogStash::Inputs::Base
227
229
  end
228
230
 
229
231
  if client_authentication?
230
- verify_mode_string = @ssl_verify_mode.upcase
231
232
  ssl_builder.setCertificateAuthorities(@ssl_certificate_authorities)
232
233
  end
233
234
  end
234
235
 
235
236
  ssl_context = ssl_builder.build()
236
237
  ssl_handler_provider = org.logstash.plugins.inputs.http.util.SslHandlerProvider.new(ssl_context)
237
- ssl_handler_provider.setVerifyMode(verify_mode_string)
238
+ ssl_handler_provider.setVerifyMode(@ssl_verify_mode_final.upcase)
238
239
  ssl_handler_provider.setProtocols(convert_protocols)
239
240
  ssl_handler_provider.setHandshakeTimeoutMilliseconds(@ssl_handshake_timeout)
240
241
 
@@ -254,7 +255,7 @@ class LogStash::Inputs::Http < LogStash::Inputs::Base
254
255
  end
255
256
 
256
257
  def require_certificate_authorities?
257
- @ssl_verify_mode == "force_peer" || @ssl_verify_mode == "peer"
258
+ @ssl_verify_mode_final == "force_peer" || @ssl_verify_mode_final == "peer"
258
259
  end
259
260
 
260
261
  def normalized_ciphers
@@ -6,6 +6,8 @@ require "stud/temporary"
6
6
  require "zlib"
7
7
  require "stringio"
8
8
 
9
+ java_import "io.netty.handler.ssl.util.SelfSignedCertificate"
10
+
9
11
  describe LogStash::Inputs::Http do
10
12
 
11
13
  before do
@@ -355,15 +357,65 @@ describe LogStash::Inputs::Http do
355
357
  end
356
358
  end
357
359
  context "with :ssl_certificate" do
358
- let(:ssl_certificate) { Stud::Temporary.file }
359
- let(:ssl_key) { Stud::Temporary.file }
360
+ let(:ssc) { SelfSignedCertificate.new }
361
+ let(:ssl_certificate) { ssc.certificate }
362
+ let(:ssl_key) { ssc.private_key }
363
+
364
+ after(:each) { ssc.delete }
365
+
360
366
  subject { LogStash::Inputs::Http.new("port" => port, "ssl" => true,
361
367
  "ssl_certificate" => ssl_certificate.path,
362
368
  "ssl_key" => ssl_key.path) }
363
369
  it "should not raise exception" do
364
- expect(subject).to receive(:build_ssl_params)
365
370
  expect { subject.register }.to_not raise_exception
366
371
  end
372
+
373
+ context "with ssl_verify_mode = none" do
374
+ subject { LogStash::Inputs::Http.new("port" => port, "ssl" => true,
375
+ "ssl_certificate" => ssl_certificate.path,
376
+ "ssl_key" => ssl_key.path,
377
+ "ssl_verify_mode" => "none"
378
+ ) }
379
+ it "should not raise exception" do
380
+ expect { subject.register }.to_not raise_exception
381
+ end
382
+ end
383
+ ["peer", "force_peer"].each do |verify_mode|
384
+ context "with ssl_verify_mode = #{verify_mode}" do
385
+ subject { LogStash::Inputs::Http.new("port" => port, "ssl" => true,
386
+ "ssl_certificate" => ssl_certificate.path,
387
+ "ssl_certificate_authorities" => ssl_certificate.path,
388
+ "ssl_key" => ssl_key.path,
389
+ "ssl_verify_mode" => verify_mode
390
+ ) }
391
+ it "should not raise exception" do
392
+ expect { subject.register }.to_not raise_exception
393
+ end
394
+ end
395
+ end
396
+ context "with verify_mode = none" do
397
+ subject { LogStash::Inputs::Http.new("port" => port, "ssl" => true,
398
+ "ssl_certificate" => ssl_certificate.path,
399
+ "ssl_key" => ssl_key.path,
400
+ "verify_mode" => "none"
401
+ ) }
402
+ it "should not raise exception" do
403
+ expect { subject.register }.to_not raise_exception
404
+ end
405
+ end
406
+ ["peer", "force_peer"].each do |verify_mode|
407
+ context "with verify_mode = #{verify_mode}" do
408
+ subject { LogStash::Inputs::Http.new("port" => port, "ssl" => true,
409
+ "ssl_certificate" => ssl_certificate.path,
410
+ "ssl_certificate_authorities" => ssl_certificate.path,
411
+ "ssl_key" => ssl_key.path,
412
+ "verify_mode" => verify_mode
413
+ ) }
414
+ it "should not raise exception" do
415
+ expect { subject.register }.to_not raise_exception
416
+ end
417
+ end
418
+ end
367
419
  end
368
420
  end
369
421
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1
4
+ version: 3.2.2
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-31 00:00:00.000000000 Z
11
+ date: 2018-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -141,7 +141,7 @@ files:
141
141
  - vendor/jar-dependencies/io/netty/netty-all/4.1.18.Final/netty-all-4.1.18.Final.jar
142
142
  - vendor/jar-dependencies/io/netty/netty-tcnative-boringssl-static/2.0.7.Final/netty-tcnative-boringssl-static-2.0.7.Final.jar
143
143
  - vendor/jar-dependencies/org/apache/logging/log4j/log4j-api/2.6.2/log4j-api-2.6.2.jar
144
- - vendor/jar-dependencies/org/logstash/plugins/input/http/logstash-input-http/3.2.1/logstash-input-http-3.2.1.jar
144
+ - vendor/jar-dependencies/org/logstash/plugins/input/http/logstash-input-http/3.2.2/logstash-input-http-3.2.2.jar
145
145
  homepage: http://www.elastic.co/guide/en/logstash/current/index.html
146
146
  licenses:
147
147
  - Apache License (2.0)