Skip to content

Commit 80e0314

Browse files
fixed webrick
Signed-off-by: Athishpranav2003 <athishanna@gmail.com>
1 parent eb63436 commit 80e0314

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

lib/fluent/plugin/out_http.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,8 @@ def setup_http_option
270270
OpenSSL::SSL::VERIFY_PEER
271271
end
272272
opt[:ciphers] = @tls_ciphers
273-
opt[:min_version] = Fluent::TLS::DEFAULT_VERSION
274-
opt[:max_version] = @tls_version
273+
opt[:min_version] = Fluent::TLS::METHODS_MAP[@tls_version]
274+
opt[:max_version] = Fluent::TLS::METHODS_MAP[@tls_version]
275275
end
276276

277277
opt

lib/fluent/tls.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ module TLS
4848
MIN_MAX_AVAILABLE = false
4949
map
5050
end
51-
private_constant :METHODS_MAP
51+
# private_constant :METHODS_MAP
5252

5353
# Helper for old syntax/method support:
5454
# ruby 2.4 uses ssl_version= but this method is now deprecated.
5555
# min_version=/max_version= use 'TLS1_2' but ssl_version= uses 'TLSv1_2'
56-
def set_version_to_context(ctx, version, min_version, max_version)
56+
def set_version_to_context(ctx, version, min_version: nil, max_version: nil)
5757
if MIN_MAX_AVAILABLE
5858
case
5959
when min_version.nil? && max_version.nil?

test/plugin/test_out_http.rb

+2
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,7 @@ def server_config
501501
# WEBrick supports self-generated self-signed certificate
502502
config[:SSLEnable] = true
503503
config[:SSLCertName] = [["CN", WEBrick::Utils::getservername]]
504+
config[:SSLMaxVersion] = OpenSSL::SSL::TLS1_3_VERSION
504505
config
505506
end
506507

@@ -512,6 +513,7 @@ def test_write_with_https
512513
d = create_driver(%[
513514
endpoint https://127.0.0.1:#{server_port}/test
514515
tls_verify_mode none
516+
tls_version TLSv1_3
515517
ssl_timeout 2s
516518
])
517519
d.run(default_tag: 'test.http') do

0 commit comments

Comments
 (0)