Skip to content

Commit ee2422f

Browse files
optimize: add error checking for SSL_set_tlsext_status_type().
1 parent 8df9125 commit ee2422f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/ngx_stream_lua_socket_tcp.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,8 +1793,12 @@ ngx_stream_lua_socket_tcp_sslhandshake(lua_State *L)
17931793
if (n >= 5) {
17941794
if (lua_toboolean(L, 5)) {
17951795
#ifdef NGX_STREAM_LUA_USE_OCSP
1796-
SSL_set_tlsext_status_type(c->ssl->connection,
1797-
TLSEXT_STATUSTYPE_ocsp);
1796+
if (SSL_set_tlsext_status_type(c->ssl->connection,
1797+
TLSEXT_STATUSTYPE_ocsp) != 1)
1798+
{
1799+
return luaL_error(L,
1800+
"failed to enable OCSP stapling");
1801+
}
17981802
#else
17991803
return luaL_error(L, "no OCSP support");
18001804
#endif

0 commit comments

Comments
 (0)