Skip to content

Commit

Permalink
added tls support to the redis client
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Porter <[email protected]>
  • Loading branch information
portertech committed Mar 8, 2018
1 parent 61e3483 commit b35d3ef
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/sensu/redis/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def initialize(options={})
@port = (options[:port] || 6379).to_i
@db = options[:db]
@password = options[:password]
@tls = options[:tls] || options[:ssl]
@auto_reconnect = options.fetch(:auto_reconnect, true)
@reconnect_on_error = options.fetch(:reconnect_on_error, true)
@error_callback = Proc.new {}
Expand Down Expand Up @@ -264,12 +265,14 @@ def verify_version
end

# This method is called by EM when the connection is
# established. This method is reponsible for validating the
# connection before Redis commands can be sent.
# established. This method is reponsible for upgrading to TLS if
# necessary and validating the connection before Redis commands
# can be sent.
def connection_completed
@response_callbacks = []
@multibulk_count = false
@connected = true
start_tls(@tls) unless @tls.nil?
authenticate do
select_db
verify_version do
Expand Down

0 comments on commit b35d3ef

Please sign in to comment.