logstash-input-tcp 6.0.2-java → 6.0.3-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: f82b021e38562b73fd86db67622bf4e701c318877db99e2975c439bbbfcbc9f0
4
- data.tar.gz: 45be9692924611030546fc05ef18046ffca0e4430fb6b5647cf5255948f89895
3
+ metadata.gz: 403704dc430009f35b036df09b638c613f345f33da52fbf750788b4e649760d6
4
+ data.tar.gz: c2443349ab82648037fcf4748cb4130f45e65bf3efadeec60db8e3124223c4e9
5
5
  SHA512:
6
- metadata.gz: c2a1aac5ed786a53c841e440f9aab3d2132e1979284302d30bc1b16c206eb3716a940709e189d9b9fd276dcf6bda4661f4969822f1a5a8c089447819070dd46f
7
- data.tar.gz: e3ffa0f369214f727bc3dc2202e5d8ff1eaf379a6c8aff2df0a652a616dae723c483a4042294a52d2c8f80412a1c62101ba3049dfcdde01fc54448d8809e7c1f
6
+ metadata.gz: 1e26da0f4abe68fbbcbb62d148bee467bdc71494462a608929850dbdda2c67f3bc87fd7ea68cab6306e41cca567f752940631a6f2276c467c437412438c99142
7
+ data.tar.gz: f54efa720d20246c05c84b63b5477707b7d16659c57d5e684138485b0908cd94ea4b14ce553d56d5eefc08ec6796e5f81548c41c025d4ff4a330f5aae59434a5
@@ -1,3 +1,6 @@
1
+ ## 6.0.3
2
+ - Skip empty lines while reading certificate files [#144](https://github.com/logstash-plugins/logstash-input-tcp/issues/144)
3
+
1
4
  ## 6.0.2
2
5
  - Fixed race condition where data would be accepted before queue was configured
3
6
 
@@ -127,12 +127,19 @@ class SslOptions
127
127
 
128
128
  private
129
129
  def fetch_certificates_from_file(file, cf)
130
- fis = FileInputStream.new(file)
130
+ fis = java.io.FileInputStream.new(file)
131
131
 
132
132
  while (fis.available > 0) do
133
- yield cf.generateCertificate(fis)
133
+ cert = generate_certificate(cf, fis)
134
+ yield cert if cert
134
135
  end
135
136
  ensure
136
137
  fis.close if fis
137
138
  end
139
+
140
+ def generate_certificate(cf, fis)
141
+ cf.generateCertificate(fis)
142
+ rescue Java::JavaSecurityCert::CertificateException => e
143
+ raise e unless e.cause.message == "Empty input"
144
+ end
138
145
  end
@@ -382,6 +382,35 @@ describe LogStash::Inputs::Tcp do
382
382
  ssc.delete
383
383
  end
384
384
  end
385
+
386
+ context "with multiple certificates with empty spaces in them" do
387
+ let(:ssc) { SelfSignedCertificate.new }
388
+ let(:certificate_file) { ssc.certificate }
389
+ let(:key_file) { ssc.private_key}
390
+ let(:ssc_2) { SelfSignedCertificate.new }
391
+ let(:certificate_file_2) { ssc.certificate }
392
+ let(:config) do
393
+ {
394
+ "host" => "127.0.0.1",
395
+ "port" => port,
396
+ "ssl_enable" => true,
397
+ "ssl_cert" => certificate_file.path,
398
+ "ssl_key" => key_file.path
399
+ }
400
+ end
401
+ before(:each) do
402
+ File.open(certificate_file.path, "a") do |file|
403
+ path = ssc_2.certificate.path
404
+ file.puts("\n")
405
+ file.puts(IO.read(path))
406
+ file.puts("\n")
407
+ end
408
+ end
409
+
410
+ it "should register without errors" do
411
+ expect { subject.register }.to_not raise_error
412
+ end
413
+ end
385
414
  end
386
415
  end
387
416
 
data/version CHANGED
@@ -1 +1 @@
1
- 6.0.2
1
+ 6.0.3
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-tcp
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.2
4
+ version: 6.0.3
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-09 00:00:00.000000000 Z
11
+ date: 2019-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -164,7 +164,7 @@ files:
164
164
  - logstash-input-tcp.gemspec
165
165
  - spec/inputs/tcp_spec.rb
166
166
  - spec/spec_helper.rb
167
- - vendor/jar-dependencies/org/logstash/inputs/logstash-input-tcp/6.0.2/logstash-input-tcp-6.0.2.jar
167
+ - vendor/jar-dependencies/org/logstash/inputs/logstash-input-tcp/6.0.3/logstash-input-tcp-6.0.3.jar
168
168
  - version
169
169
  homepage: http://www.elastic.co/guide/en/logstash/current/index.html
170
170
  licenses: