From 39fdbfe9593607bc7f4a9fee9dee0ab322cf21de Mon Sep 17 00:00:00 2001 From: Mouse Date: Thu, 19 Oct 2023 13:21:51 -0400 Subject: [PATCH] Support web proxy in external interop tests (#288) Update oqsprovider-externalinterop.sh to support web proxy in external interop tests. To determine whether to resort to proxy handling, checks if env var `HTTP_PROXY` is set --- scripts/oqsprovider-externalinterop.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/oqsprovider-externalinterop.sh b/scripts/oqsprovider-externalinterop.sh index d90dff68..f2af0f32 100755 --- a/scripts/oqsprovider-externalinterop.sh +++ b/scripts/oqsprovider-externalinterop.sh @@ -18,9 +18,15 @@ if [ -z "$DYLD_LIBRARY_PATH" ]; then export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH fi +# We assume the value of env var HTTP_PROXY is "http://host.domain:port_num" +if [ ! -z "${HTTP_PROXY}" ]; then + echo "Using Web proxy \"${HTTP_PROXY}\"" + export USE_PROXY="-proxy ${HTTP_PROXY#http://} -allow_proxy_certs" +else + export USE_PROXY="" +fi + echo " Cloudflare:" export OQS_CODEPOINT_X25519_KYBER512=65072 -(echo -e "GET /cdn-cgi/trace HTTP/1.1\nHost: cloudflare.com\n\n"; sleep 1; echo $'\cc') | $OPENSSL_APP s_client -connect pq.cloudflareresearch.com:443 -groups x25519_kyber768 -servername cloudflare.com -ign_eof 2>/dev/null | grep kex=X25519Kyber768Draft00 -(echo -e "GET /cdn-cgi/trace HTTP/1.1\nHost: cloudflare.com\n\n"; sleep 1; echo $'\cc') | $OPENSSL_APP s_client -connect pq.cloudflareresearch.com:443 -groups x25519_kyber512 -servername cloudflare.com -ign_eof 2>/dev/null | grep kex=X25519Kyber512Draft00 - - +(echo -e "GET /cdn-cgi/trace HTTP/1.1\nHost: cloudflare.com\n\n"; sleep 1; echo $'\cc') | "${OPENSSL_APP}" s_client ${USE_PROXY} -connect pq.cloudflareresearch.com:443 -groups x25519_kyber768 -servername cloudflare.com -ign_eof 2>/dev/null | grep kex=X25519Kyber768Draft00 +(echo -e "GET /cdn-cgi/trace HTTP/1.1\nHost: cloudflare.com\n\n"; sleep 1; echo $'\cc') | "${OPENSSL_APP}" s_client ${USE_PROXY} -connect pq.cloudflareresearch.com:443 -groups x25519_kyber512 -servername cloudflare.com -ign_eof 2>/dev/null | grep kex=X25519Kyber512Draft00