Skip to content

Commit f96dad3

Browse files
edmocostayaauie
andauthored
fix: restore use of DefaultHostnameVerifier (#193)
* Document why we are using :default instead of :strict Co-authored-by: Ry Biesemeyer <[email protected]>
1 parent 903bf79 commit f96dad3

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 4.17.2
2+
- Fixes a regression introduced in 4.17.0 which could prevent a connection from being established to Elasticsearch in some SSL configurations [#193](https://github.com/logstash-plugins/logstash-input-elasticsearch/pull/193)
3+
14
## 4.17.1
25
- Fix: scroll slice high memory consumption [#189](https://github.com/logstash-plugins/logstash-input-elasticsearch/pull/189)
36

lib/logstash/inputs/elasticsearch.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,9 @@ def setup_client_ssl
521521
"to make sure your data is secure set `ssl_verification_mode => full`"
522522
ssl_options[:verify] = :disable
523523
else
524-
ssl_options[:verify] = :strict
524+
# Manticore's :default maps to Apache HTTP Client's DefaultHostnameVerifier,
525+
# which is the modern STRICT verifier that replaces the deprecated StrictHostnameVerifier
526+
ssl_options[:verify] = :default
525527
end
526528
end
527529

logstash-input-elasticsearch.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Gem::Specification.new do |s|
22

33
s.name = 'logstash-input-elasticsearch'
4-
s.version = '4.17.1'
4+
s.version = '4.17.2'
55
s.licenses = ['Apache License (2.0)']
66
s.summary = "Reads query results from an Elasticsearch cluster"
77
s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"

spec/inputs/elasticsearch_ssl_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123

124124
it "should pass the flag to the ES client" do
125125
expect(::Elasticsearch::Client).to receive(:new) do |args|
126-
expect(args[:ssl]).to match hash_including(:ssl => true, :verify => :strict)
126+
expect(args[:ssl]).to match hash_including(:ssl => true, :verify => :default)
127127
end.and_return(es_client_double)
128128

129129
subject.register
@@ -200,7 +200,7 @@
200200
:truststore => ssl_truststore_path,
201201
:truststore_type => "jks",
202202
:truststore_password => "foo",
203-
:verify => :strict,
203+
:verify => :default,
204204
:cipher_suites => ["TLS_DHE_RSA_WITH_AES_256_CBC_SHA256"],
205205
:protocols => ["TLSv1.3"],
206206
)
@@ -236,7 +236,7 @@
236236
:ca_file => ssl_certificate_authorities_path,
237237
:client_cert => ssl_certificate_path,
238238
:client_key => ssl_key_path,
239-
:verify => :strict,
239+
:verify => :default,
240240
:cipher_suites => ["TLS_DHE_RSA_WITH_AES_256_CBC_SHA256"],
241241
:protocols => ["TLSv1.3"],
242242
)

0 commit comments

Comments
 (0)