42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
# File 'lib/logstash/outputs/elasticsearch/shield.rb', line 42
def _setup_transport_ssl
settings = {}
if @protocol == "node" && (@ssl || @user || @password) then
@logger.warn "Shield is not supported on \"node\" protocol: switching to \"transport\".."
@protocol = "transport"
end
require 'logstash-output-elasticsearch-shield_jars'
if @ssl
settings['shield.transport.ssl'] = @ssl
settings['shield.ssl.keystore.path'] = @keystore if @keystore
settings['shield.ssl.keystore.password'] = @keystore_password.value if @keystore_password
settings['shield.transport.ssl.truststore.path'] = @truststore if @truststore
settings['shield.transport.ssl.truststore.password'] = @truststore_password.value if @truststore_password
end
if @user && @password
settings['request.headers.Authorization'] =
'Basic ' + Base64.strict_encode64(@user + ':' + @password.value)
end
settings
end
|