Skip to content

Commit

Permalink
Merge branch 'hotfix/cassandra-ssl-ca'
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaultcha committed Jan 30, 2016
2 parents f97fc27 + efc02ed commit 650f3fd
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions kong/cli/services/nginx.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,14 @@ local function prepare_ssl_certificates(configuration)
return false, err
end

local trusted_ssl_cert_path = configuration.dao_config.ssl_certificate -- DAO ssl cert
local trusted_ssl_cert_path = configuration.dao_config.ssl and
configuration.dao_config.ssl.certificate_authority or nil

return { ssl_cert_path = res.ssl_cert_path,
ssl_key_path = res.ssl_key_path,
trusted_ssl_cert_path = trusted_ssl_cert_path }
return {
ssl_cert_path = res.ssl_cert_path,
ssl_key_path = res.ssl_key_path,
trusted_ssl_cert_path = trusted_ssl_cert_path
}
end

local function get_current_user()
Expand All @@ -68,7 +71,8 @@ local function prepare_nginx_configuration(configuration, ssl_config)
memory_cache_size = configuration.memory_cache_size,
ssl_cert = ssl_config.ssl_cert_path,
ssl_key = ssl_config.ssl_key_path,
lua_ssl_trusted_certificate = ssl_config.trusted_ssl_cert_path ~= nil and "lua_ssl_trusted_certificate \""..ssl_config.trusted_ssl_cert_path.."\";" or ""
lua_ssl_trusted_certificate = ssl_config.trusted_ssl_cert_path and
'lua_ssl_trusted_certificate "'..configuration.dao_config.ssl.certificate_authority..'";'
}

-- Auto-tune
Expand Down Expand Up @@ -174,10 +178,10 @@ function Nginx:_get_cmd()
"/usr/local/opt/openresty/bin/",
"/usr/local/bin/",
"/usr/sbin/"
}, function(path)
}, function(path)
local res, code = IO.os_execute(path.." -v")
if code == 0 then
return res:match("^nginx version: ngx_openresty/") or
return res:match("^nginx version: ngx_openresty/") or
res:match("^nginx version: openresty/")
end

Expand Down Expand Up @@ -241,4 +245,4 @@ function Nginx:quit()
return self:_invoke_signal(cmd, QUIT)
end

return Nginx
return Nginx

0 comments on commit 650f3fd

Please sign in to comment.