Skip to content

Commit 4a30c82

Browse files
committed
Renamed cacert parameter to cafile
Stick with LuaSec API conventions (as this parameter is LuaSec only anyway). Using a different name causes confusion for no reason.
1 parent db37ea3 commit 4a30c82

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

docs/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ <h3>Parameters:</h3>
115115
<li><span class="parameter">tags</span> extra tags to include on all reported errors</li>
116116
<li><span class="parameter">logger</span></li>
117117
<li><span class="parameter">verify_ssl</span> boolean of whether to perform SSL certificate verification</li>
118-
<li><span class="parameter">cacert</span> path to CA certificate bundle file (defaults to ./data/cacert.pem).
119-
Useful only when using luasec, ngx version uses the <tt>lua_ssl_trusted_certificate</tt> directive for this.</li>
118+
<li><span class="parameter">cafile</span> path to CA certificate bundle file.
119+
Required only when using luasec, ngx version uses the <tt>lua_ssl_trusted_certificate</tt> directive for this.</li>
120120
</ul>
121121
For example:
122122
<pre>{ tags = { foo = "bar", abc = "def" }, logger = "myLogger", verify_ssl = false }</pre>
@@ -290,7 +290,7 @@ <h3>Usage:</h3>
290290
</div> <!-- id="main" -->
291291
<div id="about">
292292
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
293-
<i style="float:right;">Last updated 2017-05-10 15:09:54 </i>
293+
<i style="float:right;">Last updated 2017-05-16 12:19:18 </i>
294294
</div> <!-- id="about" -->
295295
</div> <!-- id="container" -->
296296
</body>

raven.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ _M._parse_dsn = _parse_dsn
227227
-- <li><span class="parameter">tags</span> extra tags to include on all reported errors</li>
228228
-- <li><span class="parameter">logger</span></li>
229229
-- <li><span class="parameter">verify_ssl</span> boolean of whether to perform SSL certificate verification</li>
230-
-- <li><span class="parameter">cacert</span> path to CA certificate bundle file.
230+
-- <li><span class="parameter">cafile</span> path to CA certificate bundle file.
231231
-- Required only when using luasec, ngx version uses the <tt>lua_ssl_trusted_certificate</tt> directive for this.</li>
232232
-- </ul>
233233
-- For example:
@@ -268,7 +268,7 @@ function _M.new(self, dsn, conf)
268268
end
269269

270270

271-
obj.cacert = conf.cacert
271+
obj.cafile = conf.cafile
272272
end
273273

274274
return setmetatable(obj, mt)
@@ -557,7 +557,7 @@ function _M.lua_wrap_tls(self, sock)
557557
mode = "client",
558558
protocol = "tlsv1_2",
559559
verify = self.verify_ssl and "peer" or "none",
560-
cafile = self.verify_ssl and self.cacert or nil,
560+
cafile = self.verify_ssl and self.cafile or nil,
561561
options = "all",
562562
})
563563
if not sock then

tests/test_https.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ function test_validate_cert_ok()
104104
else
105105
rvn = raven:new(get_dsn(), {
106106
tags = { foo = "bar" },
107-
cacert = "./tests/certs/ca.cert.pem",
107+
cafile = "./tests/certs/ca.cert.pem",
108108
})
109109
local id = rvn:captureMessage("Sentry is a realtime event logging and aggregation platform.")
110110
assert_not_nil(id)
@@ -124,7 +124,7 @@ function test_validate_cert_failure()
124124
-- load the certificate for another CA, it must fail
125125
rvn = raven:new(get_dsn(), {
126126
tags = { foo = "bar" },
127-
cacert = "./tests/certs/wrongca.cert.pem",
127+
cafile = "./tests/certs/wrongca.cert.pem",
128128
})
129129
local ok, err = rvn:captureMessage("Sentry is a realtime event logging and aggregation platform.")
130130
assert_nil(ok)

0 commit comments

Comments
 (0)