From 73a4092f8a88b7fabd7aa5e6c1d9f381fd749d02 Mon Sep 17 00:00:00 2001 From: yhirose Date: Fri, 11 Sep 2026 16:35:11 -0400 Subject: [PATCH] Point the remaining httpbingo.org proxy tests at the self-hosted httpbin ProxyTest, RedirectTest.HTTPBin*, KeepAliveTest and ProxyTest.SSLOpenStream still sent their requests through the squid proxies to the external httpbingo.org, so an upstream hiccup there failed CI with no code change involved (KeepAliveTest.SSLWithDigest got a 502 on its first /get). Switch them to the "httpbin" container (nginx + go-httpbin) that BaseAuthTest/DigestAuthTest already use. go-httpbin serves /get, /redirect/n and /digest-auth the same way, so the test logic is unchanged; the SSL variants disable certificate verification for the self-signed test cert, as BaseAuthTest.SSL does. RedirectTest.YouTube* is left pointing at youtube.com since it exercises a real cross-host, http -> https redirect chain. Claude-Session: https://claude.ai/code/session_0148ZAzsuYRYXkwcA7UFeh95 --- test/test_proxy.cc | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/test/test_proxy.cc b/test/test_proxy.cc index f83786b7..ffc9c849 100644 --- a/test/test_proxy.cc +++ b/test/test_proxy.cc @@ -22,23 +22,25 @@ template void ProxyTest(T &cli, bool basic) { } TEST(ProxyTest, NoSSLBasic) { - Client cli("httpbingo.org"); + Client cli("httpbin"); ProxyTest(cli, true); } #ifdef CPPHTTPLIB_SSL_ENABLED TEST(ProxyTest, SSLBasic) { - SSLClient cli("httpbingo.org"); + SSLClient cli("httpbin"); + cli.enable_server_certificate_verification(false); ProxyTest(cli, true); } TEST(ProxyTest, NoSSLDigest) { - Client cli("httpbingo.org"); + Client cli("httpbin"); ProxyTest(cli, false); } TEST(ProxyTest, SSLDigest) { - SSLClient cli("httpbingo.org"); + SSLClient cli("httpbin"); + cli.enable_server_certificate_verification(false); ProxyTest(cli, false); } #endif @@ -63,23 +65,25 @@ void RedirectProxyText(T &cli, const char *path, bool basic) { } TEST(RedirectTest, HTTPBinNoSSLBasic) { - Client cli("httpbingo.org"); + Client cli("httpbin"); RedirectProxyText(cli, "/redirect/2", true); } #ifdef CPPHTTPLIB_SSL_ENABLED TEST(RedirectTest, HTTPBinNoSSLDigest) { - Client cli("httpbingo.org"); + Client cli("httpbin"); RedirectProxyText(cli, "/redirect/2", false); } TEST(RedirectTest, HTTPBinSSLBasic) { - SSLClient cli("httpbingo.org"); + SSLClient cli("httpbin"); + cli.enable_server_certificate_verification(false); RedirectProxyText(cli, "/redirect/2", true); } TEST(RedirectTest, HTTPBinSSLDigest) { - SSLClient cli("httpbingo.org"); + SSLClient cli("httpbin"); + cli.enable_server_certificate_verification(false); RedirectProxyText(cli, "/redirect/2", false); } #endif @@ -333,22 +337,24 @@ template void KeepAliveTest(T &cli, bool basic) { #ifdef CPPHTTPLIB_SSL_ENABLED TEST(KeepAliveTest, NoSSLWithBasic) { - Client cli("httpbingo.org"); + Client cli("httpbin"); KeepAliveTest(cli, true); } TEST(KeepAliveTest, SSLWithBasic) { - SSLClient cli("httpbingo.org"); + SSLClient cli("httpbin"); + cli.enable_server_certificate_verification(false); KeepAliveTest(cli, true); } TEST(KeepAliveTest, NoSSLWithDigest) { - Client cli("httpbingo.org"); + Client cli("httpbin"); KeepAliveTest(cli, false); } TEST(KeepAliveTest, SSLWithDigest) { - SSLClient cli("httpbingo.org"); + SSLClient cli("httpbin"); + cli.enable_server_certificate_verification(false); KeepAliveTest(cli, false); } #endif @@ -357,7 +363,8 @@ TEST(KeepAliveTest, SSLWithDigest) { #ifdef CPPHTTPLIB_SSL_ENABLED TEST(ProxyTest, SSLOpenStream) { - SSLClient cli("httpbingo.org"); + SSLClient cli("httpbin"); + cli.enable_server_certificate_verification(false); cli.set_proxy("localhost", 3128); cli.set_proxy_basic_auth("hello", "world");