Skip to content

Commit 8d180cf

Browse files
committed
Test: integration spec with TLSv1.2 vs TLSv1.3
1 parent 02391d6 commit 8d180cf

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

Diff for: spec/integration/outputs/index_spec.rb

+26-3
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,38 @@
157157
}
158158
end
159159
it_behaves_like("an indexer", true)
160-
161-
describe "with a password requiring escaping" do
160+
161+
context 'with enforced TLSv1.3 protocol' do
162+
let(:config) { super().merge 'ssl_enabled_protocols' => [ 'TLSv1.3' ] }
163+
164+
it_behaves_like("an indexer", true)
165+
end
166+
167+
context 'with enforced TLSv1.2 protocol (while ES only enabled TLSv1.3)' do
168+
let(:config) { super().merge 'ssl_enabled_protocols' => [ 'TLSv1.2' ] }
169+
170+
it "does not ship events" do
171+
subject.multi_receive(events)
172+
173+
http_client.post("#{es_url}/_refresh").call
174+
175+
response = http_client.get("#{index_url}/_count?q=*")
176+
result = LogStash::Json.load(response.body)
177+
cur_count = result["count"]
178+
expect(cur_count).to eq(0) # ES output keeps re-trying but ends up with a
179+
# [Manticore::ClientProtocolException] Received fatal alert: protocol_version
180+
end
181+
182+
end if ENV['ES_SSL_SUPPORTED_PROTOCOLS'] == 'TLSv1.3'
183+
184+
context "with a password requiring escaping" do
162185
let(:user) { "f@ncyuser" }
163186
let(:password) { "ab%12#" }
164187

165188
include_examples("an indexer", true)
166189
end
167190

168-
describe "with a user/password requiring escaping in the URL" do
191+
context "with a user/password requiring escaping in the URL" do
169192
let(:config) do
170193
{
171194
"hosts" => ["https://#{CGI.escape(user)}:#{CGI.escape(password)}@elasticsearch:9200"],

0 commit comments

Comments
 (0)