Skip to content

Commit 3d19fe1

Browse files
tests: internal: guard HTTPS proxy cases on FLB_HAVE_TLS
Signed-off-by: Antônio Franco <13881523+antoniomrfranco@users.noreply.github.com>
1 parent 884cc55 commit 3d19fe1

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

tests/internal/utils.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,8 @@ struct proxy_url_check proxy_url_checks[] = {
658658
/* issue #5530. Password contains @ */
659659
{0, "http://example_user:example_pass_w_@_char@proxy.com:8080",
660660
"http", "proxy.com", "8080", "example_user", "example_pass_w_@_char"},
661+
/* HTTPS proxy cases: accepted only when TLS support is compiled in */
662+
#ifdef FLB_HAVE_TLS
661663
/* HTTPS proxy with explicit port */
662664
{0, "https://proxy.com:8080",
663665
"https", "proxy.com", "8080", NULL, NULL},
@@ -667,6 +669,12 @@ struct proxy_url_check proxy_url_checks[] = {
667669
/* HTTPS proxy with credentials */
668670
{0, "https://user:pass@proxy.com:443",
669671
"https", "proxy.com", "443", "user", "pass"},
672+
#else
673+
/* Without TLS support, HTTPS proxy URLs must be rejected */
674+
{-1, "https://proxy.com:8080", NULL, NULL, NULL, NULL, NULL},
675+
{-1, "https://proxy.com", NULL, NULL, NULL, NULL, NULL},
676+
{-1, "https://user:pass@proxy.com:443", NULL, NULL, NULL, NULL, NULL},
677+
#endif
670678
/* Unsupported schemes must be rejected */
671679
{-1, "ftp://proxy.com:21", NULL, NULL, NULL, NULL, NULL},
672680
{-1, "socks5://proxy.com", NULL, NULL, NULL, NULL, NULL},

0 commit comments

Comments
 (0)