Skip to content

Commit

Permalink
Renamed cacert parameter to cafile
Browse files Browse the repository at this point in the history
Stick with LuaSec API conventions (as this parameter is LuaSec only
anyway). Using a different name causes confusion for no reason.
  • Loading branch information
jdesgats committed May 16, 2017
1 parent db37ea3 commit 4a30c82
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ <h3>Parameters:</h3>
<li><span class="parameter">tags</span> extra tags to include on all reported errors</li>
<li><span class="parameter">logger</span></li>
<li><span class="parameter">verify_ssl</span> boolean of whether to perform SSL certificate verification</li>
<li><span class="parameter">cacert</span> path to CA certificate bundle file (defaults to ./data/cacert.pem).
Useful only when using luasec, ngx version uses the <tt>lua_ssl_trusted_certificate</tt> directive for this.</li>
<li><span class="parameter">cafile</span> path to CA certificate bundle file.
Required only when using luasec, ngx version uses the <tt>lua_ssl_trusted_certificate</tt> directive for this.</li>
</ul>
For example:
<pre>{ tags = { foo = "bar", abc = "def" }, logger = "myLogger", verify_ssl = false }</pre>
Expand Down Expand Up @@ -290,7 +290,7 @@ <h3>Usage:</h3>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2017-05-10 15:09:54 </i>
<i style="float:right;">Last updated 2017-05-16 12:19:18 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
6 changes: 3 additions & 3 deletions raven.lua
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ _M._parse_dsn = _parse_dsn
-- <li><span class="parameter">tags</span> extra tags to include on all reported errors</li>
-- <li><span class="parameter">logger</span></li>
-- <li><span class="parameter">verify_ssl</span> boolean of whether to perform SSL certificate verification</li>
-- <li><span class="parameter">cacert</span> path to CA certificate bundle file.
-- <li><span class="parameter">cafile</span> path to CA certificate bundle file.
-- Required only when using luasec, ngx version uses the <tt>lua_ssl_trusted_certificate</tt> directive for this.</li>
-- </ul>
-- For example:
Expand Down Expand Up @@ -268,7 +268,7 @@ function _M.new(self, dsn, conf)
end


obj.cacert = conf.cacert
obj.cafile = conf.cafile
end

return setmetatable(obj, mt)
Expand Down Expand Up @@ -557,7 +557,7 @@ function _M.lua_wrap_tls(self, sock)
mode = "client",
protocol = "tlsv1_2",
verify = self.verify_ssl and "peer" or "none",
cafile = self.verify_ssl and self.cacert or nil,
cafile = self.verify_ssl and self.cafile or nil,
options = "all",
})
if not sock then
Expand Down
4 changes: 2 additions & 2 deletions tests/test_https.lua
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function test_validate_cert_ok()
else
rvn = raven:new(get_dsn(), {
tags = { foo = "bar" },
cacert = "./tests/certs/ca.cert.pem",
cafile = "./tests/certs/ca.cert.pem",
})
local id = rvn:captureMessage("Sentry is a realtime event logging and aggregation platform.")
assert_not_nil(id)
Expand All @@ -124,7 +124,7 @@ function test_validate_cert_failure()
-- load the certificate for another CA, it must fail
rvn = raven:new(get_dsn(), {
tags = { foo = "bar" },
cacert = "./tests/certs/wrongca.cert.pem",
cafile = "./tests/certs/wrongca.cert.pem",
})
local ok, err = rvn:captureMessage("Sentry is a realtime event logging and aggregation platform.")
assert_nil(ok)
Expand Down

0 comments on commit 4a30c82

Please sign in to comment.