mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-09-30 20:52:31 +07:00
These tests exercise the squid proxies by hitting /basic-auth and /digest-auth on an external httpbin-style site. That site's identity has already moved twice (httpbin.org -> httpcan.org, per #2300) chasing uptime, and httpcan.org itself is now down (Cloudflare 502 from its origin), failing CI with no code change involved. Adds two containers to the existing squid docker-compose stack instead: go-httpbin (mccutchen/go-httpbin) as the backend, and an nginx sidecar in front of it under the single "httpbin" hostname so both the NoSSL tests (port 80) and the SSL tests, which CONNECT-tunnel through the proxy to port 443, resolve the same name -- go-httpbin only listens on one port at a time, so it can't serve both protocols itself. nginx uses the repo's existing self-signed test cert; the SSL client tests already disable verification for it like other self-signed-cert tests in this suite. go-httpbin was picked over the more feature-complete kennethreitz/httpbin after finding the latter accepts a wrong digest-auth username as long as the password matches -- confirmed with a direct curl against the container, unrelated to anything in this repo. go-httpbin correctly rejects both. The trade-off is losing SHA-512 digest-auth coverage here, since go-httpbin only implements MD5 and SHA-256; nothing else in the suite exercises SHA-512 digest auth against a live server. Response body assertions are adjusted to go-httpbin's actual JSON shape (an added "authorized" field, no "algorithm" field), and the domain changes from httpcan.org to the self-hosted "httpbin". This only affects 'make proxy'/'make proxy_mbedtls'/'make proxy_wolfssl' and the Proxy Test CI workflow -- the default 'make' target is untouched.
23 lines
424 B
Plaintext
23 lines
424 B
Plaintext
server {
|
|
listen 80;
|
|
server_name httpbin;
|
|
|
|
location / {
|
|
proxy_pass http://httpbin_backend:8080;
|
|
proxy_set_header Host $host;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
server_name httpbin;
|
|
|
|
ssl_certificate /etc/nginx/certs/cert.pem;
|
|
ssl_certificate_key /etc/nginx/certs/key.pem;
|
|
|
|
location / {
|
|
proxy_pass http://httpbin_backend:8080;
|
|
proxy_set_header Host $host;
|
|
}
|
|
}
|