logstash-input-tcp 6.0.0-java → 6.0.1-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: 8f95c4b965fd69c58c8ea30cebdfbd74838e07051b3491e9c88da3a6029b7bdf
4
- data.tar.gz: a21e7f3a68395d29f40d083f77933191d702e553f14903d3062a163c0f550aa6
3
+ metadata.gz: b302df6e39b800aa93dc56ddeff90534f404c8e322a7d6ac5f359123e964dc3a
4
+ data.tar.gz: 77db42b004f85076fc336424b8fe30c10ac107c6e4a90ce68e7ffee63159651b
5
5
  SHA512:
6
- metadata.gz: a928baf3ca1703fb850d09bc587299809b78b387b41c2a920f525d28d7ae335224b9d1f2dfa9f74ea91a88d1c45e4005c001bfe90fa5f6fa46ca476fe83ebc63
7
- data.tar.gz: dd835f99eefdcdb04602beb68bb3c2f03a9fea58468f3c90dfb4461710740e9d0e56b992b9528ffc608872af4fc3d032286d4af7abd99d11b847483d4be657eb
6
+ metadata.gz: e531556d356c2037e23168faf0848b05ea4a7760e60a04be9a045a69d0cce07b5edb0ea7a84314bd47cad55f050bee5ffcf8e6d186c12796efce1db9cf86e112
7
+ data.tar.gz: 91b06eee36084aa9de3e7bfd71920d6e0c77085d26e2cc51df7abeec208f540e17c08c06a220b20efe0d6f7b4eaeed4426aee192f1c9d62ebad7d8d61deb00b0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 6.0.1
2
+ - Support multiple certificates per file [#140](https://github.com/logstash-plugins/logstash-input-tcp/pull/140)
3
+
1
4
  ## 6.0.0
2
5
  - Removed obsolete `data_timeout` and `ssl_cacert` options
3
6
 
@@ -76,7 +76,9 @@ class SslOptions
76
76
  # create certificate object
77
77
  cf = CertificateFactory.getInstance("X.509")
78
78
  cert_chain = []
79
- cert_chain << cf.generateCertificate(FileInputStream.new(@ssl_cert_path))
79
+ fetch_certificates_from_file(@ssl_cert_path, cf) do |cert|
80
+ cert_chain << cert
81
+ end
80
82
 
81
83
  # convert key from pkcs1 to pkcs8 and get PrivateKey object
82
84
  pem_parser = PEMParser.new(FileReader.new(@ssl_key_path))
@@ -100,13 +102,19 @@ class SslOptions
100
102
  raise "Could not recognize 'ssl_key' format. Class: #{obj.class}"
101
103
  end
102
104
 
103
- @ssl_extra_chain_certs.each do |cert|
104
- cert_chain << cf.generateCertificate(FileInputStream.new(cert))
105
+ @ssl_extra_chain_certs.each do |file|
106
+ fetch_certificates_from_file(file, cf) do |cert|
107
+ cert_chain << cert
108
+ end
105
109
  end
106
110
  sslContextBuilder = SslContextBuilder.forServer(private_key, @ssl_key_passphrase, cert_chain.to_java(X509Certificate))
107
111
 
108
- trust_certs = @ssl_certificate_authorities.map do |cert|
109
- cf.generateCertificate(FileInputStream.new(cert))
112
+ trust_certs = []
113
+
114
+ @ssl_certificate_authorities.each do |file|
115
+ fetch_certificates_from_file(file, cf) do |cert|
116
+ trust_certs << cert
117
+ end
110
118
  end
111
119
 
112
120
  if trust_certs.any?
@@ -116,4 +124,15 @@ class SslOptions
116
124
  sslContextBuilder.clientAuth(@ssl_verify ? ClientAuth::REQUIRE : ClientAuth::NONE)
117
125
  sslContextBuilder.build()
118
126
  end
127
+
128
+ private
129
+ def fetch_certificates_from_file(file, cf)
130
+ fis = FileInputStream.new(file)
131
+
132
+ while (fis.available > 0) do
133
+ yield cf.generateCertificate(fis)
134
+ end
135
+ ensure
136
+ fis.close if fis
137
+ end
119
138
  end
data/version CHANGED
@@ -1 +1 @@
1
- 6.0.0
1
+ 6.0.1
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.0
4
+ version: 6.0.1
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-11 00:00:00.000000000 Z
11
+ date: 2019-03-08 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.0/logstash-input-tcp-6.0.0.jar
167
+ - vendor/jar-dependencies/org/logstash/inputs/logstash-input-tcp/6.0.1/logstash-input-tcp-6.0.1.jar
168
168
  - version
169
169
  homepage: http://www.elastic.co/guide/en/logstash/current/index.html
170
170
  licenses: