Skip to content

Commit 9d930a7

Browse files
bugfix: failed to build with openssl 1.x.x/boringssl/libressl.
1 parent 9f1b459 commit 9d930a7

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/ngx_http_lua_proxy_ssl_verifyby.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,20 +265,40 @@ int
265265
ngx_http_lua_proxy_ssl_verify_handler(X509_STORE_CTX *x509_store, void *arg)
266266
{
267267
#if defined(LIBRESSL_VERSION_NUMBER)
268+
ngx_connection_t *c;
268269

270+
c = ngx_ssl_get_connection(ssl_conn); /* upstream connection */
271+
ngx_ssl_conn_t *ssl_conn;
272+
273+
ssl_conn = X509_STORE_CTX_get_ex_data(x509_store,
274+
SSL_get_ex_data_X509_STORE_CTX_idx());
269275
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
270276
"LibreSSL does not support by proxy_ssl_verify_by_lua*");
271277

272278
return 1;
273279

274280
#elif defined(OPENSSL_IS_BORINGSSL)
281+
ngx_connection_t *c;
282+
ngx_ssl_conn_t *ssl_conn;
283+
284+
ssl_conn = X509_STORE_CTX_get_ex_data(x509_store,
285+
SSL_get_ex_data_X509_STORE_CTX_idx());
286+
c = ngx_ssl_get_connection(ssl_conn); /* upstream connection */
287+
275288

276289
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
277290
"BoringSSL does not support by proxy_ssl_verify_by_lua*");
278291

279292
return 1;
280293
#elif defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER < 0x30000020uL)
281294

295+
ngx_connection_t *c;
296+
ngx_ssl_conn_t *ssl_conn;
297+
298+
ssl_conn = X509_STORE_CTX_get_ex_data(x509_store,
299+
SSL_get_ex_data_X509_STORE_CTX_idx());
300+
c = ngx_ssl_get_connection(ssl_conn); /* upstream connection */
301+
282302
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
283303
"OpenSSL(< 3.0.2) does not support by proxy_ssl_verify_by_lua*");
284304

0 commit comments

Comments
 (0)