Skip to content

Commit

Permalink
fix(c*) pass lua_trusted_ssl_cert to lua-cassandra
Browse files Browse the repository at this point in the history
Set LuaSocket's `cafile` option when we are in a context that does not
support cosockets.

Fix #2528
See thibaultcha/lua-cassandra#95
  • Loading branch information
thibaultcha committed May 19, 2017
1 parent 7d386f2 commit 2b2ebf2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions kong/dao/db/cassandra.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ function _M.new(kong_config)
max_schema_consensus_wait = kong_config.cassandra_schema_consensus_timeout,
ssl = kong_config.cassandra_ssl,
verify = kong_config.cassandra_ssl_verify,
cafile = kong_config.lua_ssl_trusted_certificate,
lock_timeout = 30,
silent = ngx.IS_CLI
silent = ngx.IS_CLI,
}

if ngx.IS_CLI then
Expand Down Expand Up @@ -196,14 +197,14 @@ function _M:close_coordinator()
return nil, "no coordinator"
end

local ok, err = coordinator:close()
if not ok then
local _, err = coordinator:close()
if err then
return nil, err
end

coordinator = nil

return ok
return true
end

function _M:wait_for_schema_consensus()
Expand Down

0 comments on commit 2b2ebf2

Please sign in to comment.