Commit d54ce3ee46 for openssl.org
commit d54ce3ee4645a25969453f19550172c5d7b02504
Author: andrei2308 <andrei2308cht@proton.me>
Date: Wed Apr 15 18:24:47 2026 +0300
Add test for empty proxy server adaptation
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
MergeDate: Wed Apr 29 15:25:33 2026
(Merged from https://github.com/openssl/openssl/pull/30848)
diff --git a/test/http_test.c b/test/http_test.c
index c7e4630d93..e70e132e23 100644
--- a/test/http_test.c
+++ b/test/http_test.c
@@ -575,6 +575,14 @@ static int test_hdr_resp_hdr_limit_256(void)
return test_http_resp_hdr_limit(256);
}
+static int test_http_adapt_proxy_empty_server(void)
+{
+ const char *proxy = "http://proxy.local:8080";
+
+ return TEST_str_eq(OSSL_HTTP_adapt_proxy(proxy, "abc", "", 0), proxy)
+ && TEST_str_eq(OSSL_HTTP_adapt_proxy(proxy, "abc", "[]", 0), proxy);
+}
+
void cleanup_tests(void)
{
X509_free(x509);
@@ -625,5 +633,6 @@ int setup_tests(void)
ADD_TEST(test_hdr_resp_hdr_limit_none);
ADD_TEST(test_hdr_resp_hdr_limit_short);
ADD_TEST(test_hdr_resp_hdr_limit_256);
+ ADD_TEST(test_http_adapt_proxy_empty_server);
return 1;
}