Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for capturing frame local variables #19

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Add verify_ssl and cacert options for certificate verification with H…
…TTPS
LewisJEllis committed Apr 12, 2017
commit 497da761f33779cb9c8b812441d614ad07d4874e
17 changes: 14 additions & 3 deletions raven.lua
Original file line number Diff line number Diff line change
@@ -244,6 +244,8 @@ function _M.new(self, dsn, conf)
obj.client_id = "raven-lua/" .. version
-- default level "error"
obj.level = "error"
obj.verify_ssl = true
obj.cacert = "./data/cacert.pem"

if conf then
if conf.tags then
@@ -253,6 +255,14 @@ function _M.new(self, dsn, conf)
if conf.logger then
obj.logger = conf.logger
end

if conf.verify_ssl == false then
obj.verify_ssl = false
end

if conf.cacert then
obj.cacert = conf.cacert
end
end

return setmetatable(obj, mt)
@@ -539,8 +549,9 @@ function _M.lua_wrap_tls(self, sock)

sock, err = ssl.wrap(sock, {
mode = "client",
protocol = "tlsv1",
verify = "peer",
protocol = "tlsv1_2",
verify = self.verify_ssl and "peer" or "none",
cafile = self.verify_ssl and self.cacert or nil,
options = "all",
})
if not sock then
@@ -557,7 +568,7 @@ end

-- ngx_wrap_tls: Enables TLS for ngx.socket
function _M.ngx_wrap_tls(self, sock)
local session, err = sock:sslhandshake(false, self.host, true)
local session, err = sock:sslhandshake(false, self.host, self.verify_ssl)
if not session then
return nil, err
end