Skip to content

Commit 15fe376

Browse files
committed
tests: fix ci
1 parent de4580e commit 15fe376

2 files changed

Lines changed: 97 additions & 2 deletions

File tree

src/ngx_stream_lua_proxy_ssl_verifyby.c

Lines changed: 92 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,20 @@ ngx_int_t
3232
ngx_stream_lua_proxy_ssl_verify_set_callback(ngx_conf_t *cf)
3333
{
3434

35-
#ifdef LIBRESSL_VERSION_NUMBER
35+
#if defined(LIBRESSL_VERSION_NUMBER)
3636

3737
ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
3838
"LibreSSL does not support by proxy_ssl_verify_by_lua*");
3939

4040
return NGX_ERROR;
4141

42+
#elif defined(OPENSSL_IS_BORINGSSL)
43+
44+
ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
45+
"BoringSSL does not support by proxy_ssl_verify_by_lua*");
46+
47+
return NGX_ERROR;
48+
4249
#else
4350

4451
ngx_flag_t proxy_ssl = 0;
@@ -161,6 +168,22 @@ char *
161168
ngx_stream_lua_proxy_ssl_verify_by_lua(ngx_conf_t *cf, ngx_command_t *cmd,
162169
void *conf)
163170
{
171+
#if defined(LIBRESSL_VERSION_NUMBER)
172+
173+
ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
174+
"LibreSSL does not support by proxy_ssl_verify_by_lua*");
175+
176+
return NGX_CONF_ERROR;
177+
178+
#elif defined(OPENSSL_IS_BORINGSSL)
179+
180+
ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
181+
"BoringSSL does not support by proxy_ssl_verify_by_lua*");
182+
183+
return NGX_CONF_ERROR;
184+
185+
#else
186+
164187
#if (!defined SSL_ERROR_WANT_RETRY_VERIFY \
165188
|| OPENSSL_VERSION_NUMBER < 0x30000020L)
166189

@@ -244,12 +267,30 @@ ngx_stream_lua_proxy_ssl_verify_by_lua(ngx_conf_t *cf, ngx_command_t *cmd,
244267
return NGX_CONF_OK;
245268

246269
#endif /* SSL_ERROR_WANT_RETRY_VERIFY */
270+
271+
#endif
247272
}
248273

249274

250275
int
251276
ngx_stream_lua_proxy_ssl_verify_handler(X509_STORE_CTX *x509_store, void *arg)
252277
{
278+
#if defined(LIBRESSL_VERSION_NUMBER)
279+
280+
ngx_log_debug0(NGX_LOG_DEBUG_STREAM, c->log, 0,
281+
"LibreSSL does not support by proxy_ssl_verify_by_lua*");
282+
283+
return 1;
284+
285+
#elif defined(OPENSSL_IS_BORINGSSL)
286+
287+
ngx_log_debug0(NGX_LOG_DEBUG_STREAM, c->log, 0,
288+
"BoringSSL does not support by proxy_ssl_verify_by_lua*");
289+
290+
return 1;
291+
292+
#else
293+
253294
lua_State *L;
254295
ngx_int_t rc;
255296
ngx_connection_t *c;
@@ -395,6 +436,8 @@ ngx_stream_lua_proxy_ssl_verify_handler(X509_STORE_CTX *x509_store, void *arg)
395436

396437
return 0; /* verify failure or error */
397438
#endif
439+
440+
#endif
398441
}
399442

400443

@@ -573,6 +616,20 @@ int
573616
ngx_stream_lua_ffi_proxy_ssl_set_verify_result(ngx_stream_lua_request_t *r,
574617
int verify_result, char **err)
575618
{
619+
#if defined(LIBRESSL_VERSION_NUMBER)
620+
621+
*err = "LibreSSL does not support this function";
622+
623+
return NGX_ERROR;
624+
625+
#elif defined(OPENSSL_IS_BORINGSSL)
626+
627+
*err = "BoringSSL does not support this function";
628+
629+
return NGX_ERROR;
630+
631+
#else
632+
576633
#ifdef SSL_ERROR_WANT_RETRY_VERIFY
577634
ngx_stream_upstream_t *u;
578635
ngx_ssl_conn_t *ssl_conn;
@@ -618,13 +675,29 @@ ngx_stream_lua_ffi_proxy_ssl_set_verify_result(ngx_stream_lua_request_t *r,
618675

619676
return NGX_ERROR;
620677
#endif
678+
679+
#endif
621680
}
622681

623682

624683
int
625684
ngx_stream_lua_ffi_proxy_ssl_get_verify_result(ngx_stream_lua_request_t *r,
626685
char **err)
627686
{
687+
#if defined(LIBRESSL_VERSION_NUMBER)
688+
689+
*err = "LibreSSL does not support this function";
690+
691+
return NGX_ERROR;
692+
693+
#elif defined(OPENSSL_IS_BORINGSSL)
694+
695+
*err = "BoringSSL does not support this function";
696+
697+
return NGX_ERROR;
698+
699+
#else
700+
628701
#ifdef SSL_ERROR_WANT_RETRY_VERIFY
629702
ngx_stream_upstream_t *u;
630703
ngx_ssl_conn_t *ssl_conn;
@@ -668,6 +741,8 @@ ngx_stream_lua_ffi_proxy_ssl_get_verify_result(ngx_stream_lua_request_t *r,
668741

669742
return NGX_ERROR;
670743
#endif
744+
745+
#endif
671746
}
672747

673748

@@ -684,6 +759,20 @@ void *
684759
ngx_stream_lua_ffi_proxy_ssl_get_verify_cert(ngx_stream_lua_request_t *r,
685760
char **err)
686761
{
762+
#if defined(LIBRESSL_VERSION_NUMBER)
763+
764+
*err = "LibreSSL does not support this function";
765+
766+
return NGX_ERROR;
767+
768+
#elif defined(OPENSSL_IS_BORINGSSL)
769+
770+
*err = "BoringSSL does not support this function";
771+
772+
return NGX_ERROR;
773+
774+
#else
775+
687776
#ifdef SSL_ERROR_WANT_RETRY_VERIFY
688777
ngx_stream_upstream_t *u;
689778
ngx_ssl_conn_t *ssl_conn;
@@ -735,6 +824,8 @@ ngx_stream_lua_ffi_proxy_ssl_get_verify_cert(ngx_stream_lua_request_t *r,
735824

736825
return NULL;
737826
#endif
827+
828+
#endif
738829
}
739830

740831

t/164-proxy-ssl-verify-by.t

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@ if ($openssl_version =~ m/built with OpenSSL (\d+)\.(\d+)\.(\d+)/) {
1313
if ($major < 3 || ($major == 3 && $minor == 0 && $patch < 2)) {
1414
plan(skip_all => "too old OpenSSL, need >= 3.0.2, was " .
1515
"$major.$minor.$patch");
16+
} else {
17+
plan tests => repeat_each() * (blocks() * 6 + 3);
1618
}
19+
} elsif ($openssl_version =~ m/running with BoringSSL/) {
20+
plan(skip_all => "does not support BoringSSL");
1721
} else {
18-
plan tests => repeat_each() * (blocks() * 6 + 5);
22+
die "unknown SSL";
1923
}
2024

2125
$ENV{TEST_NGINX_HTML_DIR} ||= html_dir();

0 commit comments

Comments
 (0)