Skip to content

Commit 83dce02

Browse files
bugfix: failed to build with openssl 1.x.x and boringssl.
1 parent 47e9c4e commit 83dce02

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

‎src/ngx_stream_lua_proxy_ssl_verifyby.c‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,20 +279,40 @@ ngx_stream_lua_proxy_ssl_verify_handler(X509_STORE_CTX *x509_store, void *arg)
279279
{
280280
#if defined(LIBRESSL_VERSION_NUMBER)
281281

282+
ngx_connection_t *c;
283+
ngx_ssl_conn_t *ssl_conn;
284+
285+
ssl_conn = X509_STORE_CTX_get_ex_data(x509_store,
286+
SSL_get_ex_data_X509_STORE_CTX_idx());
287+
c = ngx_ssl_get_connection(ssl_conn); /* upstream connection */
288+
282289
ngx_log_debug0(NGX_LOG_DEBUG_STREAM, c->log, 0,
283290
"LibreSSL does not support by proxy_ssl_verify_by_lua*");
284291

285292
return 1;
286293

287294
#elif defined(OPENSSL_IS_BORINGSSL)
288295

296+
ngx_connection_t *c;
297+
ngx_ssl_conn_t *ssl_conn;
298+
299+
ssl_conn = X509_STORE_CTX_get_ex_data(x509_store,
300+
SSL_get_ex_data_X509_STORE_CTX_idx());
301+
c = ngx_ssl_get_connection(ssl_conn); /* upstream connection */
302+
289303
ngx_log_debug0(NGX_LOG_DEBUG_STREAM, c->log, 0,
290304
"BoringSSL does not support by proxy_ssl_verify_by_lua*");
291305

292306
return 1;
293307

294308
#elif defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER < 0x30000020uL)
295309

310+
ngx_connection_t *c;
311+
ngx_ssl_conn_t *ssl_conn;
312+
313+
ssl_conn = X509_STORE_CTX_get_ex_data(x509_store,
314+
SSL_get_ex_data_X509_STORE_CTX_idx());
315+
c = ngx_ssl_get_connection(ssl_conn); /* upstream connection */
296316
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
297317
"OpenSSL(< 3.0.2) does not support by proxy_ssl_verify_by_lua*");
298318

0 commit comments

Comments
 (0)