Skip to content

Commit 7eb1757

Browse files
committed
fixed merge issues in the previous commit; also fixed the test suite for ssl-cert-by-lua.
1 parent f0b5373 commit 7eb1757

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

src/ngx_http_lua_sslcertby.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ ngx_http_lua_ssl_cert_handler_file(ngx_http_request_t *r,
3535
{
3636
ngx_int_t rc;
3737

38-
rc = ngx_http_lua_cache_loadfile(r, L, lscf->ssl_cert_src.data,
38+
rc = ngx_http_lua_cache_loadfile(r->connection->log, L,
39+
lscf->ssl_cert_src.data,
3940
lscf->ssl_cert_src_key);
4041
if (rc != NGX_OK) {
4142
return rc;
@@ -54,7 +55,8 @@ ngx_http_lua_ssl_cert_handler_inline(ngx_http_request_t *r,
5455
{
5556
ngx_int_t rc;
5657

57-
rc = ngx_http_lua_cache_loadbuffer(r, L, lscf->ssl_cert_src.data,
58+
rc = ngx_http_lua_cache_loadbuffer(r->connection->log, L,
59+
lscf->ssl_cert_src.data,
5860
lscf->ssl_cert_src.len,
5961
lscf->ssl_cert_src_key,
6062
"=ssl_certificate_by_lua");

t/130-ssl-cert-by.t

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2183,7 +2183,7 @@ failed to create OCSP request: output buffer too small: 68 > 67
21832183
local req, err = ssl.create_ocsp_request(cert_data, 67)
21842184
if not req then
21852185
ngx.log(ngx.ERR, "failed to create OCSP request: ", err)
2186-
return
2186+
return ngx.exit(ngx.ERROR)
21872187
end
21882188
21892189
ngx.log(ngx.WARN, "OCSP request created with length ", #req)
@@ -2242,7 +2242,7 @@ failed to create OCSP request: output buffer too small: 68 > 67
22422242
GET /t
22432243
--- response_body
22442244
connected: 1
2245-
ssl handshake: userdata
2245+
failed to do SSL handshake: handshake failed
22462246
22472247
--- error_log
22482248
lua ssl server name: "test.com"
@@ -2823,7 +2823,6 @@ OCSP response validation ok
28232823
28242824
28252825
=== TEST 28: fail to validate OCSP response - OCSP response returns revoked status
2826-
28272826
--- http_config
28282827
lua_package_path "t/lib/?.lua;lua/?.lua;../lua-resty-core/lib/?.lua;;";
28292828
@@ -2840,7 +2839,7 @@ OCSP response validation ok
28402839
cert_data, err = ssl.cert_pem_to_der(cert_data)
28412840
if not cert_data then
28422841
ngx.log(ngx.ERR, "failed to convert pem cert to der cert: ", err)
2843-
return
2842+
return ngx.exit(ngx.ERROR)
28442843
end
28452844
28462845
local f = assert(io.open("t/cert/ocsp/revoked-ocsp-resp.der"))
@@ -2850,7 +2849,7 @@ OCSP response validation ok
28502849
local req, err = ssl.validate_ocsp_response(resp, cert_data)
28512850
if not req then
28522851
ngx.log(ngx.ERR, "failed to validate OCSP response: ", err)
2853-
return
2852+
return ngx.exit(ngx.ERROR)
28542853
end
28552854
28562855
ngx.log(ngx.WARN, "OCSP response validation ok")
@@ -2904,7 +2903,7 @@ OCSP response validation ok
29042903
GET /t
29052904
--- response_body
29062905
connected: 1
2907-
ssl handshake: userdata
2906+
failed to do SSL handshake: handshake failed
29082907
29092908
--- error_log
29102909
lua ssl server name: "test.com"

t/cert/ocsp/revoked-ocsp-resp.der

1.05 KB
Binary file not shown.

util/build2.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ time ngx-build $force $version \
3030
--with-http_ssl_module \
3131
--add-module=$root/../ndk-nginx-module \
3232
--add-module=$root/../set-misc-nginx-module \
33-
--with-ld-opt="-L$PCRE_LIB -Wl,-rpath,$PCRE_LIB:$LIBDRIZZLE_LIB:/usr/local/lib" \
33+
--with-ld-opt="-L$PCRE_LIB -Wl,-rpath,$PCRE_LIB:$LIBDRIZZLE_LIB:$OPENSSL_LIB:/usr/local/lib" \
3434
--without-mail_pop3_module \
3535
--without-mail_imap_module \
3636
--with-http_image_filter_module \

0 commit comments

Comments
 (0)