Skip to content

Commit df70a5e

Browse files
committed
bugfix: fixed build failures with OpenSSL older than 0.9.8f. thanks FFCZ for the report in openresty#413.
1 parent 044f861 commit df70a5e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/ngx_http_lua_socket_tcp.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,13 +1289,23 @@ ngx_http_lua_socket_tcp_sslhandshake(lua_State *L)
12891289
"lua ssl server name: \"%*s\"", name.len,
12901290
name.data);
12911291

1292+
#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
1293+
12921294
if (SSL_set_tlsext_host_name(c->ssl->connection, name.data)
12931295
== 0)
12941296
{
12951297
lua_pushnil(L);
12961298
lua_pushliteral(L, "SSL_set_tlsext_host_name failed");
12971299
return 2;
12981300
}
1301+
1302+
#else
1303+
1304+
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
1305+
"lua socket SNI disabled because the current "
1306+
"version of OpenSSL lacks the support");
1307+
1308+
#endif
12991309
}
13001310

13011311
if (n >= 4) {

0 commit comments

Comments
 (0)