diff --git a/Dockerfile.template b/Dockerfile.template index e36f095..6d50d5b 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -145,7 +145,8 @@ RUN cd ${CURL_VERSION} && \ # Compile curl with nghttp2, libbrotli and nss (firefox) or boringssl (chrome). # Enable keylogfile for debugging of TLS traffic. RUN cd ${CURL_VERSION} && \ - ./configure --enable-static \ + ./configure --prefix=/build/install \ + --enable-static \ --disable-shared \ --with-nghttp2=/usr/local \ --with-brotli=/build/brotli-${BROTLI_VERSION}/build/installed \ @@ -159,15 +160,25 @@ RUN cd ${CURL_VERSION} && \ CFLAGS="-I/build/boringssl/build" \ {{/chrome}} USE_CURL_SSLKEYLOGFILE=true && \ - make + make && make install RUN mkdir out && \ - cp ${CURL_VERSION}/src/curl out/curl-impersonate && \ +{{#firefox}} + cp /build/install/bin/curl-impersonate-ff out/ && \ + ln -s curl-impersonate-ff out/curl-impersonate && \ +{{/firefox}} +{{#chrome}} + cp /build/install/bin/curl-impersonate-chrome out/ && \ + ln -s curl-impersonate-chrome out/curl-impersonate && \ +{{/chrome}} strip out/curl-impersonate +RUN rm -Rf /build/install + # Re-compile libcurl dynamically RUN cd ${CURL_VERSION} && \ - ./configure --with-nghttp2=/usr/local \ + ./configure --prefix=/build/install \ + --with-nghttp2=/usr/local \ --with-brotli=/build/brotli-${BROTLI_VERSION}/build/installed \ {{#firefox}} --with-nss=/build/${NSS_VERSION}/dist/Release \ @@ -179,14 +190,21 @@ RUN cd ${CURL_VERSION} && \ CFLAGS="-I/build/boringssl/build" \ {{/chrome}} USE_CURL_SSLKEYLOGFILE=true && \ - make clean && make + make clean && make && make install -# Rename to 'libcurl-impersonate' to avoid confusion, and recreate the -# symbolic links. -RUN ver=$(readlink -f curl-7.81.0/lib/.libs/libcurl.so | sed 's/.*so\.//') && \ +# Copy libcurl-impersonate and symbolic links +RUN cp -d /build/install/lib/libcurl-impersonate* /build/out + +{{#firefox}} +RUN ver=$(readlink -f curl-7.81.0/lib/.libs/libcurl-impersonate-ff.so | sed 's/.*so\.//') && \ major=$(echo -n $ver | cut -d'.' -f1) && \ - cp "${CURL_VERSION}/lib/.libs/libcurl.so.$ver" "out/libcurl-impersonate.so.$ver" && \ - ln -s "libcurl-impersonate.so.$ver" "out/libcurl-impersonate.so.$major" && \ + ln -s "libcurl-impersonate-ff.so.$ver" "out/libcurl-impersonate.so.$ver" && \ +{{/firefox}} +{{#chrome}} +RUN ver=$(readlink -f curl-7.81.0/lib/.libs/libcurl-impersonate-chrome.so | sed 's/.*so\.//') && \ + major=$(echo -n $ver | cut -d'.' -f1) && \ + ln -s "libcurl-impersonate-chrome.so.$ver" "out/libcurl-impersonate.so.$ver" && \ +{{/chrome}} ln -s "libcurl-impersonate.so.$ver" "out/libcurl-impersonate.so" && \ strip "out/libcurl-impersonate.so.$ver" @@ -215,10 +233,7 @@ RUN apk add --no-cache nss {{/firefox}} # Copy curl-impersonate from the builder image -COPY --from=builder /build/out/curl-impersonate /usr/local/bin/ +COPY --from=builder /build/install /usr/local # Wrapper scripts COPY --from=builder /build/out/curl_* /usr/local/bin/ - -# Copy libcurl-impersonate from the builder image -COPY --from=builder /build/out/libcurl-impersonate.so /usr/local/lib/ {{/alpine}} diff --git a/README.md b/README.md index cddf33c..23399f0 100644 --- a/README.md +++ b/README.md @@ -73,10 +73,10 @@ As mentioned there are two separate build systems. The **chrome** build is used ``` docker build -t curl-impersonate-chrome chrome/ ``` -The resulting image contains: -* `/build/out/curl-impersonate` - The curl binary that can impersonate Chrome/Edge/Safari. It is compiled statically against libcurl, BoringSSL, and libnghttp2 so that it won't conflict with any existing libraries on your system. You can use it from the container or copy it out. Tested to work on Ubuntu 20.04. -* `/build/out/curl_chrome98`, `/build/out/curl_chrome99`, `...` - Wrapper scripts that launch `curl-impersonate` with all the needed flags. -* `/build/out/libcurl-impersonate.so` - libcurl compiled with impersonation support. See [libcurl-impersonate](#libcurl-impersonate) below for more details. +The resulting image contains a `/build/out` directory with the following: +* `curl-impersonate-chrome`, `curl-impersonate` - The curl binary that can impersonate Chrome/Edge/Safari. It is compiled statically against libcurl, BoringSSL, and libnghttp2 so that it won't conflict with any existing libraries on your system. You can use it from the container or copy it out. Tested to work on Ubuntu 20.04. +* `curl_chrome98`, `curl_chrome99`, `...` - Wrapper scripts that launch `curl-impersonate` with all the needed flags. +* `libcurl-impersonate-chrome.so`, `libcurl-impersonate.so` - libcurl compiled with impersonation support. See [libcurl-impersonate](#libcurl-impersonate) below for more details. You can use them inside the docker, copy them out using `docker cp` or use them in a multi-stage docker build. @@ -85,10 +85,10 @@ Build with: ``` docker build -t curl-impersonate-ff firefox/ ``` -The resulting image contains: -* `/build/out/curl-impersonate` - The curl binary that can impersonate Firefox. It is compiled statically against libcurl, nss, and libnghttp2 so that it won't conflict with any existing libraries on your system. You can use it from the container or copy it out. Tested to work on Ubuntu 20.04. -* `/build/out/curl_ff91esr`, `/build/out/curl_ff95`, `...` - Wrapper scripts that launch `curl-impersonate` with all the needed flags. -* `/build/out/libcurl-impersonate.so` - libcurl compiled with impersonation support. See [libcurl-impersonate](#libcurl-impersonate) below for more details. +The resulting image contains a `/build/out` directory with the following: +* `curl-impersonate-ff`, `curl-impersonate` - The curl binary that can impersonate Firefox. It is compiled statically against libcurl, nss, and libnghttp2 so that it won't conflict with any existing libraries on your system. You can use it from the container or copy it out. Tested to work on Ubuntu 20.04. +* `curl_ff91esr`, `curl_ff95`, `...` - Wrapper scripts that launch `curl-impersonate` with all the needed flags. +* `libcurl-impersonate-ff.so`, `libcurl-impersonate.so` - libcurl compiled with impersonation support. See [libcurl-impersonate](#libcurl-impersonate) below for more details. If you use it outside the container, install the following dependency: * `sudo apt install libnss3`. Even though nss is statically compiled into `curl-impersonate`, it is still necessary to install libnss3 because curl dynamically loads `libnssckbi.so`, a file containing Mozilla's list of trusted root certificates. Alternatively, use `curl -k` to disable certificate verification. diff --git a/chrome/Dockerfile b/chrome/Dockerfile index 0511a60..0bb562b 100644 --- a/chrome/Dockerfile +++ b/chrome/Dockerfile @@ -86,7 +86,8 @@ RUN cd ${CURL_VERSION} && \ # Compile curl with nghttp2, libbrotli and nss (firefox) or boringssl (chrome). # Enable keylogfile for debugging of TLS traffic. RUN cd ${CURL_VERSION} && \ - ./configure --enable-static \ + ./configure --prefix=/build/install \ + --enable-static \ --disable-shared \ --with-nghttp2=/usr/local \ --with-brotli=/build/brotli-${BROTLI_VERSION}/build/installed \ @@ -94,28 +95,32 @@ RUN cd ${CURL_VERSION} && \ LIBS="-pthread" \ CFLAGS="-I/build/boringssl/build" \ USE_CURL_SSLKEYLOGFILE=true && \ - make + make && make install RUN mkdir out && \ - cp ${CURL_VERSION}/src/curl out/curl-impersonate && \ + cp /build/install/bin/curl-impersonate-chrome out/ && \ + ln -s curl-impersonate-chrome out/curl-impersonate && \ strip out/curl-impersonate +RUN rm -Rf /build/install + # Re-compile libcurl dynamically RUN cd ${CURL_VERSION} && \ - ./configure --with-nghttp2=/usr/local \ + ./configure --prefix=/build/install \ + --with-nghttp2=/usr/local \ --with-brotli=/build/brotli-${BROTLI_VERSION}/build/installed \ --with-openssl=/build/boringssl/build \ LIBS="-pthread" \ CFLAGS="-I/build/boringssl/build" \ USE_CURL_SSLKEYLOGFILE=true && \ - make clean && make + make clean && make && make install -# Rename to 'libcurl-impersonate' to avoid confusion, and recreate the -# symbolic links. -RUN ver=$(readlink -f curl-7.81.0/lib/.libs/libcurl.so | sed 's/.*so\.//') && \ +# Copy libcurl-impersonate and symbolic links +RUN cp -d /build/install/lib/libcurl-impersonate* /build/out + +RUN ver=$(readlink -f curl-7.81.0/lib/.libs/libcurl-impersonate-chrome.so | sed 's/.*so\.//') && \ major=$(echo -n $ver | cut -d'.' -f1) && \ - cp "${CURL_VERSION}/lib/.libs/libcurl.so.$ver" "out/libcurl-impersonate.so.$ver" && \ - ln -s "libcurl-impersonate.so.$ver" "out/libcurl-impersonate.so.$major" && \ + ln -s "libcurl-impersonate-chrome.so.$ver" "out/libcurl-impersonate.so.$ver" && \ ln -s "libcurl-impersonate.so.$ver" "out/libcurl-impersonate.so" && \ strip "out/libcurl-impersonate.so.$ver" diff --git a/chrome/Dockerfile.alpine b/chrome/Dockerfile.alpine index 963074c..ae27d15 100644 --- a/chrome/Dockerfile.alpine +++ b/chrome/Dockerfile.alpine @@ -83,7 +83,8 @@ RUN cd ${CURL_VERSION} && \ # Compile curl with nghttp2, libbrotli and nss (firefox) or boringssl (chrome). # Enable keylogfile for debugging of TLS traffic. RUN cd ${CURL_VERSION} && \ - ./configure --enable-static \ + ./configure --prefix=/build/install \ + --enable-static \ --disable-shared \ --with-nghttp2=/usr/local \ --with-brotli=/build/brotli-${BROTLI_VERSION}/build/installed \ @@ -91,28 +92,32 @@ RUN cd ${CURL_VERSION} && \ LIBS="-pthread" \ CFLAGS="-I/build/boringssl/build" \ USE_CURL_SSLKEYLOGFILE=true && \ - make + make && make install RUN mkdir out && \ - cp ${CURL_VERSION}/src/curl out/curl-impersonate && \ + cp /build/install/bin/curl-impersonate-chrome out/ && \ + ln -s curl-impersonate-chrome out/curl-impersonate && \ strip out/curl-impersonate +RUN rm -Rf /build/install + # Re-compile libcurl dynamically RUN cd ${CURL_VERSION} && \ - ./configure --with-nghttp2=/usr/local \ + ./configure --prefix=/build/install \ + --with-nghttp2=/usr/local \ --with-brotli=/build/brotli-${BROTLI_VERSION}/build/installed \ --with-openssl=/build/boringssl/build \ LIBS="-pthread" \ CFLAGS="-I/build/boringssl/build" \ USE_CURL_SSLKEYLOGFILE=true && \ - make clean && make + make clean && make && make install -# Rename to 'libcurl-impersonate' to avoid confusion, and recreate the -# symbolic links. -RUN ver=$(readlink -f curl-7.81.0/lib/.libs/libcurl.so | sed 's/.*so\.//') && \ +# Copy libcurl-impersonate and symbolic links +RUN cp -d /build/install/lib/libcurl-impersonate* /build/out + +RUN ver=$(readlink -f curl-7.81.0/lib/.libs/libcurl-impersonate-chrome.so | sed 's/.*so\.//') && \ major=$(echo -n $ver | cut -d'.' -f1) && \ - cp "${CURL_VERSION}/lib/.libs/libcurl.so.$ver" "out/libcurl-impersonate.so.$ver" && \ - ln -s "libcurl-impersonate.so.$ver" "out/libcurl-impersonate.so.$major" && \ + ln -s "libcurl-impersonate-chrome.so.$ver" "out/libcurl-impersonate.so.$ver" && \ ln -s "libcurl-impersonate.so.$ver" "out/libcurl-impersonate.so" && \ strip "out/libcurl-impersonate.so.$ver" @@ -127,9 +132,6 @@ RUN chmod +x out/curl_* FROM alpine:3.15.0 # Copy curl-impersonate from the builder image -COPY --from=builder /build/out/curl-impersonate /usr/local/bin/ +COPY --from=builder /build/install /usr/local # Wrapper scripts COPY --from=builder /build/out/curl_* /usr/local/bin/ - -# Copy libcurl-impersonate from the builder image -COPY --from=builder /build/out/libcurl-impersonate.so /usr/local/lib/ diff --git a/chrome/curl_chrome98 b/chrome/curl_chrome98 index 05d1e74..a4c0cb3 100755 --- a/chrome/curl_chrome98 +++ b/chrome/curl_chrome98 @@ -6,7 +6,7 @@ dir=`echo "$0" | sed 's%/[^/]*$%%'` # The list of ciphers can be obtained by looking at the Client Hello message in # Wireshark, then converting it using this reference # https://wiki.mozilla.org/Security/Cipher_Suites -"$dir/curl-impersonate" \ +"$dir/curl-impersonate-chrome" \ --ciphers TLS_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384,TLS_CHACHA20_POLY1305_SHA256,ECDHE-ECDSA-AES128-GCM-SHA256,ECDHE-RSA-AES128-GCM-SHA256,ECDHE-ECDSA-AES256-GCM-SHA384,ECDHE-RSA-AES256-GCM-SHA384,ECDHE-ECDSA-CHACHA20-POLY1305,ECDHE-RSA-CHACHA20-POLY1305,ECDHE-RSA-AES128-SHA,ECDHE-RSA-AES256-SHA,AES128-GCM-SHA256,AES256-GCM-SHA384,AES128-SHA,AES256-SHA \ -H 'sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="98", "Google Chrome";v="98"' \ -H 'sec-ch-ua-mobile: ?0' \ diff --git a/chrome/curl_chrome99 b/chrome/curl_chrome99 index 3919e2d..3fa6161 100755 --- a/chrome/curl_chrome99 +++ b/chrome/curl_chrome99 @@ -6,7 +6,7 @@ dir=`echo "$0" | sed 's%/[^/]*$%%'` # The list of ciphers can be obtained by looking at the Client Hello message in # Wireshark, then converting it using this reference # https://wiki.mozilla.org/Security/Cipher_Suites -"$dir/curl-impersonate" \ +"$dir/curl-impersonate-chrome" \ --ciphers TLS_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384,TLS_CHACHA20_POLY1305_SHA256,ECDHE-ECDSA-AES128-GCM-SHA256,ECDHE-RSA-AES128-GCM-SHA256,ECDHE-ECDSA-AES256-GCM-SHA384,ECDHE-RSA-AES256-GCM-SHA384,ECDHE-ECDSA-CHACHA20-POLY1305,ECDHE-RSA-CHACHA20-POLY1305,ECDHE-RSA-AES128-SHA,ECDHE-RSA-AES256-SHA,AES128-GCM-SHA256,AES256-GCM-SHA384,AES128-SHA,AES256-SHA \ -H 'sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="99", "Google Chrome";v="99"' \ -H 'sec-ch-ua-mobile: ?0' \ diff --git a/chrome/curl_chrome99_android b/chrome/curl_chrome99_android index 0ff3e4c..55e120c 100755 --- a/chrome/curl_chrome99_android +++ b/chrome/curl_chrome99_android @@ -6,7 +6,7 @@ dir=`echo "$0" | sed 's%/[^/]*$%%'` # The list of ciphers can be obtained by looking at the Client Hello message in # Wireshark, then converting it using this reference # https://wiki.mozilla.org/Security/Cipher_Suites -"$dir/curl-impersonate" \ +"$dir/curl-impersonate-chrome" \ --ciphers TLS_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384,TLS_CHACHA20_POLY1305_SHA256,ECDHE-ECDSA-AES128-GCM-SHA256,ECDHE-RSA-AES128-GCM-SHA256,ECDHE-ECDSA-AES256-GCM-SHA384,ECDHE-RSA-AES256-GCM-SHA384,ECDHE-ECDSA-CHACHA20-POLY1305,ECDHE-RSA-CHACHA20-POLY1305,ECDHE-RSA-AES128-SHA,ECDHE-RSA-AES256-SHA,AES128-GCM-SHA256,AES256-GCM-SHA384,AES128-SHA,AES256-SHA \ -H 'sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="99", "Google Chrome";v="99"' \ -H 'sec-ch-ua-mobile: ?1' \ diff --git a/chrome/curl_edge98 b/chrome/curl_edge98 index 39089a1..e41ad38 100755 --- a/chrome/curl_edge98 +++ b/chrome/curl_edge98 @@ -6,7 +6,7 @@ dir=`echo "$0" | sed 's%/[^/]*$%%'` # The list of ciphers can be obtained by looking at the Client Hello message in # Wireshark, then converting it using this reference # https://wiki.mozilla.org/Security/Cipher_Suites -"$dir/curl-impersonate" \ +"$dir/curl-impersonate-chrome" \ --ciphers TLS_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384,TLS_CHACHA20_POLY1305_SHA256,ECDHE-ECDSA-AES128-GCM-SHA256,ECDHE-RSA-AES128-GCM-SHA256,ECDHE-ECDSA-AES256-GCM-SHA384,ECDHE-RSA-AES256-GCM-SHA384,ECDHE-ECDSA-CHACHA20-POLY1305,ECDHE-RSA-CHACHA20-POLY1305,ECDHE-RSA-AES128-SHA,ECDHE-RSA-AES256-SHA,AES128-GCM-SHA256,AES256-GCM-SHA384,AES128-SHA,AES256-SHA \ -H 'sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="98", "Microsoft Edge";v="98"' \ -H 'sec-ch-ua-mobile: ?0' \ diff --git a/chrome/curl_edge99 b/chrome/curl_edge99 index 0381d2b..3aad1c8 100755 --- a/chrome/curl_edge99 +++ b/chrome/curl_edge99 @@ -6,7 +6,7 @@ dir=`echo "$0" | sed 's%/[^/]*$%%'` # The list of ciphers can be obtained by looking at the Client Hello message in # Wireshark, then converting it using this reference # https://wiki.mozilla.org/Security/Cipher_Suites -"$dir/curl-impersonate" \ +"$dir/curl-impersonate-chrome" \ --ciphers TLS_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384,TLS_CHACHA20_POLY1305_SHA256,ECDHE-ECDSA-AES128-GCM-SHA256,ECDHE-RSA-AES128-GCM-SHA256,ECDHE-ECDSA-AES256-GCM-SHA384,ECDHE-RSA-AES256-GCM-SHA384,ECDHE-ECDSA-CHACHA20-POLY1305,ECDHE-RSA-CHACHA20-POLY1305,ECDHE-RSA-AES128-SHA,ECDHE-RSA-AES256-SHA,AES128-GCM-SHA256,AES256-GCM-SHA384,AES128-SHA,AES256-SHA \ -H 'sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="99", "Microsoft Edge";v="99"' \ -H 'sec-ch-ua-mobile: ?0' \ diff --git a/chrome/curl_safari15_3 b/chrome/curl_safari15_3 index 62b32ea..6d08ead 100755 --- a/chrome/curl_safari15_3 +++ b/chrome/curl_safari15_3 @@ -6,7 +6,7 @@ dir=`echo "$0" | sed 's%/[^/]*$%%'` # The list of ciphers can be obtained by looking at the Client Hello message in # Wireshark, then converting it using this reference # https://wiki.mozilla.org/Security/Cipher_Suites -"$dir/curl-impersonate" \ +"$dir/curl-impersonate-chrome" \ --ciphers TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384:TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256:TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256:TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384:TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256:TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256:TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384:TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256:TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA:TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA:TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384:TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256:TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA:TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA:TLS_RSA_WITH_AES_256_GCM_SHA384:TLS_RSA_WITH_AES_128_GCM_SHA256:TLS_RSA_WITH_AES_256_CBC_SHA256:TLS_RSA_WITH_AES_128_CBC_SHA256:TLS_RSA_WITH_AES_256_CBC_SHA:TLS_RSA_WITH_AES_128_CBC_SHA:TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA:TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA:TLS_RSA_WITH_3DES_EDE_CBC_SHA \ --curves X25519:P-256:P-384:P-521 \ --signature-hashes ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256,rsa_pkcs1_sha256,ecdsa_secp384r1_sha384,ecdsa_sha1,rsa_pss_rsae_sha384,rsa_pss_rsae_sha384,rsa_pkcs1_sha384,rsa_pss_rsae_sha512,rsa_pkcs1_sha512,rsa_pkcs1_sha1 \ diff --git a/chrome/patches/curl-impersonate.patch b/chrome/patches/curl-impersonate.patch index 72777fc..3801b2f 100644 --- a/chrome/patches/curl-impersonate.patch +++ b/chrome/patches/curl-impersonate.patch @@ -1,5 +1,25 @@ +diff --git a/Makefile.am b/Makefile.am +index 3e55230ee..e3ea22b96 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -192,13 +192,13 @@ CLEANFILES = $(VC6_LIBDSP) $(VC6_SRCDSP) $(VC7_LIBVCPROJ) $(VC7_SRCVCPROJ) \ + $(VC11_LIBVCXPROJ) $(VC11_SRCVCXPROJ) $(VC12_LIBVCXPROJ) $(VC12_SRCVCXPROJ) \ + $(VC14_LIBVCXPROJ) $(VC14_SRCVCXPROJ) $(VC15_LIBVCXPROJ) $(VC15_SRCVCXPROJ) + +-bin_SCRIPTS = curl-config ++bin_SCRIPTS = curl-impersonate-chrome-config + + SUBDIRS = lib src + DIST_SUBDIRS = $(SUBDIRS) tests packages scripts include docs + + pkgconfigdir = $(libdir)/pkgconfig +-pkgconfig_DATA = libcurl.pc ++pkgconfig_DATA = libcurl-impersonate-chrome.pc + + # List of files required to generate VC IDE .dsp, .vcproj and .vcxproj files + include lib/Makefile.inc diff --git a/configure.ac b/configure.ac -index 63e320236..5870fa430 100644 +index 63e320236..8c41e8501 100644 --- a/configure.ac +++ b/configure.ac @@ -1331,7 +1331,8 @@ if test X"$OPT_BROTLI" != Xno; then @@ -44,6 +64,42 @@ index 63e320236..5870fa430 100644 AC_MSG_NOTICE([-L is $LD_H2]) LDFLAGS="$LDFLAGS $LD_H2" +@@ -4255,8 +4260,8 @@ AC_CONFIG_FILES([Makefile \ + tests/unit/Makefile \ + packages/Makefile \ + packages/vms/Makefile \ +- curl-config \ +- libcurl.pc ++ curl-impersonate-chrome-config:curl-config.in \ ++ libcurl-impersonate-chrome.pc:libcurl.pc.in + ]) + AC_OUTPUT + +diff --git a/curl-config.in b/curl-config.in +index 8b4a29a9a..3d6399251 100644 +--- a/curl-config.in ++++ b/curl-config.in +@@ -161,9 +161,9 @@ while test $# -gt 0; do + CURLLIBDIR="" + fi + if test "X@ENABLE_SHARED@" = "Xno"; then +- echo ${CURLLIBDIR}-lcurl @LIBCURL_LIBS@ ++ echo ${CURLLIBDIR}-lcurl-impersonate-chrome @LIBCURL_LIBS@ + else +- echo ${CURLLIBDIR}-lcurl ++ echo ${CURLLIBDIR}-lcurl-impersonate-chrome + fi + ;; + --ssl-backends) +@@ -172,7 +172,7 @@ while test $# -gt 0; do + + --static-libs) + if test "X@ENABLE_STATIC@" != "Xno" ; then +- echo @libdir@/libcurl.@libext@ @LDFLAGS@ @LIBCURL_LIBS@ ++ echo @libdir@/libcurl-impersonate-chrome.@libext@ @LDFLAGS@ @LIBCURL_LIBS@ + else + echo "curl was built with static libraries disabled" >&2 + exit 1 diff --git a/include/curl/curl.h b/include/curl/curl.h index 7b69ce2d6..a62c8a4a9 100644 --- a/include/curl/curl.h @@ -107,6 +163,86 @@ index 2dbfb26b5..e0bf86169 100644 /* * NAME curl_easy_getinfo() * +diff --git a/lib/Makefile.am b/lib/Makefile.am +index 769363941..cd59ad4b2 100644 +--- a/lib/Makefile.am ++++ b/lib/Makefile.am +@@ -32,7 +32,7 @@ EXTRA_DIST = Makefile.m32 config-win32.h config-win32ce.h \ + firefox-db2pem.sh config-vxworks.h Makefile.vxworks checksrc.pl \ + setup-win32.h .checksrc + +-lib_LTLIBRARIES = libcurl.la ++lib_LTLIBRARIES = libcurl-impersonate-chrome.la + + if BUILD_UNITTESTS + noinst_LTLIBRARIES = libcurlu.la +@@ -84,43 +84,43 @@ AM_CPPFLAGS += -DBUILDING_LIBCURL + AM_LDFLAGS = + AM_CFLAGS = + +-libcurl_la_CPPFLAGS_EXTRA = +-libcurl_la_LDFLAGS_EXTRA = +-libcurl_la_CFLAGS_EXTRA = ++libcurl_impersonate_chrome_la_CPPFLAGS_EXTRA = ++libcurl_impersonate_chrome_la_LDFLAGS_EXTRA = ++libcurl_impersonate_chrome_la_CFLAGS_EXTRA = + + if CURL_LT_SHLIB_USE_VERSION_INFO +-libcurl_la_LDFLAGS_EXTRA += $(VERSIONINFO) ++libcurl_impersonate_chrome_la_LDFLAGS_EXTRA += $(VERSIONINFO) + endif + + if CURL_LT_SHLIB_USE_NO_UNDEFINED +-libcurl_la_LDFLAGS_EXTRA += -no-undefined ++libcurl_impersonate_chrome_la_LDFLAGS_EXTRA += -no-undefined + endif + + if CURL_LT_SHLIB_USE_MIMPURE_TEXT +-libcurl_la_LDFLAGS_EXTRA += -mimpure-text ++libcurl_impersonate_chrome_la_LDFLAGS_EXTRA += -mimpure-text + endif + + if CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS +-libcurl_la_LDFLAGS_EXTRA += -Wl,--version-script=libcurl.vers ++libcurl_impersonate_chrome_la_LDFLAGS_EXTRA += -Wl,--version-script=libcurl.vers + else + # if symbol-hiding is enabled, hide them! + if DOING_CURL_SYMBOL_HIDING +-libcurl_la_LDFLAGS_EXTRA += -export-symbols-regex '^curl_.*' ++libcurl_impersonate_chrome_la_LDFLAGS_EXTRA += -export-symbols-regex '^curl_.*' + endif + endif + + if USE_CPPFLAG_CURL_STATICLIB +-libcurl_la_CPPFLAGS_EXTRA += -DCURL_STATICLIB ++libcurl_impersonate_chrome_la_CPPFLAGS_EXTRA += -DCURL_STATICLIB + endif + + if DOING_CURL_SYMBOL_HIDING +-libcurl_la_CPPFLAGS_EXTRA += -DCURL_HIDDEN_SYMBOLS +-libcurl_la_CFLAGS_EXTRA += $(CFLAG_CURL_SYMBOL_HIDING) ++libcurl_impersonate_chrome_la_CPPFLAGS_EXTRA += -DCURL_HIDDEN_SYMBOLS ++libcurl_impersonate_chrome_la_CFLAGS_EXTRA += $(CFLAG_CURL_SYMBOL_HIDING) + endif + +-libcurl_la_CPPFLAGS = $(AM_CPPFLAGS) $(libcurl_la_CPPFLAGS_EXTRA) +-libcurl_la_LDFLAGS = $(AM_LDFLAGS) $(libcurl_la_LDFLAGS_EXTRA) $(LDFLAGS) $(LIBCURL_LIBS) +-libcurl_la_CFLAGS = $(AM_CFLAGS) $(libcurl_la_CFLAGS_EXTRA) ++libcurl_impersonate_chrome_la_CPPFLAGS = $(AM_CPPFLAGS) $(libcurl_impersonate_chrome_la_CPPFLAGS_EXTRA) ++libcurl_impersonate_chrome_la_LDFLAGS = $(AM_LDFLAGS) $(libcurl_impersonate_chrome_la_LDFLAGS_EXTRA) $(LDFLAGS) $(LIBCURL_LIBS) ++libcurl_impersonate_chrome_la_CFLAGS = $(AM_CFLAGS) $(libcurl_impersonate_chrome_la_CFLAGS_EXTRA) + + libcurlu_la_CPPFLAGS = $(AM_CPPFLAGS) -DCURL_STATICLIB -DUNITTESTS + libcurlu_la_LDFLAGS = $(AM_LDFLAGS) -static $(LIBCURL_LIBS) +@@ -129,7 +129,7 @@ libcurlu_la_CFLAGS = $(AM_CFLAGS) + # Makefile.inc provides the CSOURCES and HHEADERS defines + include Makefile.inc + +-libcurl_la_SOURCES = $(CSOURCES) $(HHEADERS) ++libcurl_impersonate_chrome_la_SOURCES = $(CSOURCES) $(HHEADERS) + libcurlu_la_SOURCES = $(CSOURCES) $(HHEADERS) + + CHECKSRC = $(CS_$(V)) diff --git a/lib/easy.c b/lib/easy.c index 20293a710..0cea8af50 100644 --- a/lib/easy.c @@ -1683,6 +1819,52 @@ index 6007bbba0..3c79e0d30 100644 } #ifdef USE_SSL +diff --git a/libcurl.pc.in b/libcurl.pc.in +index 8ac15d407..986d42b0e 100644 +--- a/libcurl.pc.in ++++ b/libcurl.pc.in +@@ -34,6 +34,6 @@ Name: libcurl + URL: https://curl.se/ + Description: Library to transfer files with ftp, http, etc. + Version: @CURLVERSION@ +-Libs: -L${libdir} -lcurl @LIBCURL_NO_SHARED@ ++Libs: -L${libdir} -lcurl-impersonate-chrome @LIBCURL_NO_SHARED@ + Libs.private: @LIBCURL_LIBS@ + Cflags: -I${includedir} @CPPFLAG_CURL_STATICLIB@ +diff --git a/src/Makefile.am b/src/Makefile.am +index c8abc93b1..cf8dfdef7 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -41,7 +41,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \ + -I$(top_srcdir)/lib \ + -I$(top_srcdir)/src + +-bin_PROGRAMS = curl ++bin_PROGRAMS = curl-impersonate-chrome + + SUBDIRS = ../docs + +@@ -52,7 +52,7 @@ endif + include Makefile.inc + + # CURL_FILES comes from Makefile.inc +-curl_SOURCES = $(CURL_FILES) ++curl_impersonate_chrome_SOURCES = $(CURL_FILES) + + # This might hold -Werror + CFLAGS += @CURL_CFLAG_EXTRAS@ +@@ -61,9 +61,9 @@ CFLAGS += @CURL_CFLAG_EXTRAS@ + LIBS = $(BLANK_AT_MAKETIME) + + if USE_EXPLICIT_LIB_DEPS +-curl_LDADD = $(top_builddir)/lib/libcurl.la @LIBCURL_LIBS@ ++curl_impersonate_chrome_LDADD = $(top_builddir)/lib/libcurl-impersonate-chrome.la @LIBCURL_LIBS@ + else +-curl_LDADD = $(top_builddir)/lib/libcurl.la @NSS_LIBS@ @SSL_LIBS@ @ZLIB_LIBS@ @CURL_NETWORK_AND_TIME_LIBS@ ++curl_impersonate_chrome_LDADD = $(top_builddir)/lib/libcurl-impersonate-chrome.la @NSS_LIBS@ @SSL_LIBS@ @ZLIB_LIBS@ @CURL_NETWORK_AND_TIME_LIBS@ + endif + + # if unit tests are enabled, build a static library to link them with diff --git a/src/tool_cfgable.h b/src/tool_cfgable.h index 227b914e3..9f0d0b18b 100644 --- a/src/tool_cfgable.h diff --git a/firefox/Dockerfile b/firefox/Dockerfile index 407d29e..d1e5cc7 100644 --- a/firefox/Dockerfile +++ b/firefox/Dockerfile @@ -82,34 +82,39 @@ RUN cd ${CURL_VERSION} && \ # Compile curl with nghttp2, libbrotli and nss (firefox) or boringssl (chrome). # Enable keylogfile for debugging of TLS traffic. RUN cd ${CURL_VERSION} && \ - ./configure --enable-static \ + ./configure --prefix=/build/install \ + --enable-static \ --disable-shared \ --with-nghttp2=/usr/local \ --with-brotli=/build/brotli-${BROTLI_VERSION}/build/installed \ --with-nss=/build/${NSS_VERSION}/dist/Release \ CFLAGS="-I/build/${NSS_VERSION}/dist/public/nss -I/build/${NSS_VERSION}/dist/Release/include/nspr" \ USE_CURL_SSLKEYLOGFILE=true && \ - make + make && make install RUN mkdir out && \ - cp ${CURL_VERSION}/src/curl out/curl-impersonate && \ + cp /build/install/bin/curl-impersonate-ff out/ && \ + ln -s curl-impersonate-ff out/curl-impersonate && \ strip out/curl-impersonate +RUN rm -Rf /build/install + # Re-compile libcurl dynamically RUN cd ${CURL_VERSION} && \ - ./configure --with-nghttp2=/usr/local \ + ./configure --prefix=/build/install \ + --with-nghttp2=/usr/local \ --with-brotli=/build/brotli-${BROTLI_VERSION}/build/installed \ --with-nss=/build/${NSS_VERSION}/dist/Release \ CFLAGS="-I/build/${NSS_VERSION}/dist/public/nss -I/build/${NSS_VERSION}/dist/Release/include/nspr" \ USE_CURL_SSLKEYLOGFILE=true && \ - make clean && make + make clean && make && make install -# Rename to 'libcurl-impersonate' to avoid confusion, and recreate the -# symbolic links. -RUN ver=$(readlink -f curl-7.81.0/lib/.libs/libcurl.so | sed 's/.*so\.//') && \ +# Copy libcurl-impersonate and symbolic links +RUN cp -d /build/install/lib/libcurl-impersonate* /build/out + +RUN ver=$(readlink -f curl-7.81.0/lib/.libs/libcurl-impersonate-ff.so | sed 's/.*so\.//') && \ major=$(echo -n $ver | cut -d'.' -f1) && \ - cp "${CURL_VERSION}/lib/.libs/libcurl.so.$ver" "out/libcurl-impersonate.so.$ver" && \ - ln -s "libcurl-impersonate.so.$ver" "out/libcurl-impersonate.so.$major" && \ + ln -s "libcurl-impersonate-ff.so.$ver" "out/libcurl-impersonate.so.$ver" && \ ln -s "libcurl-impersonate.so.$ver" "out/libcurl-impersonate.so" && \ strip "out/libcurl-impersonate.so.$ver" diff --git a/firefox/Dockerfile.alpine b/firefox/Dockerfile.alpine index 656b603..4bcb214 100644 --- a/firefox/Dockerfile.alpine +++ b/firefox/Dockerfile.alpine @@ -77,34 +77,39 @@ RUN cd ${CURL_VERSION} && \ # Compile curl with nghttp2, libbrotli and nss (firefox) or boringssl (chrome). # Enable keylogfile for debugging of TLS traffic. RUN cd ${CURL_VERSION} && \ - ./configure --enable-static \ + ./configure --prefix=/build/install \ + --enable-static \ --disable-shared \ --with-nghttp2=/usr/local \ --with-brotli=/build/brotli-${BROTLI_VERSION}/build/installed \ --with-nss=/build/${NSS_VERSION}/dist/Release \ CFLAGS="-I/build/${NSS_VERSION}/dist/public/nss -I/build/${NSS_VERSION}/dist/Release/include/nspr" \ USE_CURL_SSLKEYLOGFILE=true && \ - make + make && make install RUN mkdir out && \ - cp ${CURL_VERSION}/src/curl out/curl-impersonate && \ + cp /build/install/bin/curl-impersonate-ff out/ && \ + ln -s curl-impersonate-ff out/curl-impersonate && \ strip out/curl-impersonate +RUN rm -Rf /build/install + # Re-compile libcurl dynamically RUN cd ${CURL_VERSION} && \ - ./configure --with-nghttp2=/usr/local \ + ./configure --prefix=/build/install \ + --with-nghttp2=/usr/local \ --with-brotli=/build/brotli-${BROTLI_VERSION}/build/installed \ --with-nss=/build/${NSS_VERSION}/dist/Release \ CFLAGS="-I/build/${NSS_VERSION}/dist/public/nss -I/build/${NSS_VERSION}/dist/Release/include/nspr" \ USE_CURL_SSLKEYLOGFILE=true && \ - make clean && make + make clean && make && make install -# Rename to 'libcurl-impersonate' to avoid confusion, and recreate the -# symbolic links. -RUN ver=$(readlink -f curl-7.81.0/lib/.libs/libcurl.so | sed 's/.*so\.//') && \ +# Copy libcurl-impersonate and symbolic links +RUN cp -d /build/install/lib/libcurl-impersonate* /build/out + +RUN ver=$(readlink -f curl-7.81.0/lib/.libs/libcurl-impersonate-ff.so | sed 's/.*so\.//') && \ major=$(echo -n $ver | cut -d'.' -f1) && \ - cp "${CURL_VERSION}/lib/.libs/libcurl.so.$ver" "out/libcurl-impersonate.so.$ver" && \ - ln -s "libcurl-impersonate.so.$ver" "out/libcurl-impersonate.so.$major" && \ + ln -s "libcurl-impersonate-ff.so.$ver" "out/libcurl-impersonate.so.$ver" && \ ln -s "libcurl-impersonate.so.$ver" "out/libcurl-impersonate.so" && \ strip "out/libcurl-impersonate.so.$ver" @@ -123,9 +128,6 @@ FROM alpine:3.15.0 RUN apk add --no-cache nss # Copy curl-impersonate from the builder image -COPY --from=builder /build/out/curl-impersonate /usr/local/bin/ +COPY --from=builder /build/install /usr/local # Wrapper scripts COPY --from=builder /build/out/curl_* /usr/local/bin/ - -# Copy libcurl-impersonate from the builder image -COPY --from=builder /build/out/libcurl-impersonate.so /usr/local/lib/ diff --git a/firefox/curl_ff91esr b/firefox/curl_ff91esr index ca2ca78..4862a96 100755 --- a/firefox/curl_ff91esr +++ b/firefox/curl_ff91esr @@ -6,7 +6,7 @@ dir=`echo "$0" | sed 's%/[^/]*$%%'` # The list of ciphers can be obtained by looking at the Client Hello message in # Wireshark, then converting it using the cipherlist array at # https://github.com/curl/curl/blob/master/lib/vtls/nss.c -"$dir/curl-impersonate" \ +"$dir/curl-impersonate-ff" \ --ciphers aes_128_gcm_sha_256,chacha20_poly1305_sha_256,aes_256_gcm_sha_384,ecdhe_ecdsa_aes_128_gcm_sha_256,ecdhe_rsa_aes_128_gcm_sha_256,ecdhe_ecdsa_chacha20_poly1305_sha_256,ecdhe_rsa_chacha20_poly1305_sha_256,ecdhe_ecdsa_aes_256_gcm_sha_384,ecdhe_rsa_aes_256_gcm_sha_384,ecdhe_ecdsa_aes_256_sha,ecdhe_ecdsa_aes_128_sha,ecdhe_rsa_aes_128_sha,ecdhe_rsa_aes_256_sha,rsa_aes_128_gcm_sha_256,rsa_aes_256_gcm_sha_384,rsa_aes_128_sha,rsa_aes_256_sha,rsa_3des_ede_cbc_sha \ -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0' \ -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' \ diff --git a/firefox/curl_ff95 b/firefox/curl_ff95 index 9b81314..a433a8c 100755 --- a/firefox/curl_ff95 +++ b/firefox/curl_ff95 @@ -6,7 +6,7 @@ dir=`echo "$0" | sed 's%/[^/]*$%%'` # The list of ciphers can be obtained by looking at the Client Hello message in # Wireshark, then converting it using the cipherlist array at # https://github.com/curl/curl/blob/master/lib/vtls/nss.c -"$dir/curl-impersonate" \ +"$dir/curl-impersonate-ff" \ --ciphers aes_128_gcm_sha_256,chacha20_poly1305_sha_256,aes_256_gcm_sha_384,ecdhe_ecdsa_aes_128_gcm_sha_256,ecdhe_rsa_aes_128_gcm_sha_256,ecdhe_ecdsa_chacha20_poly1305_sha_256,ecdhe_rsa_chacha20_poly1305_sha_256,ecdhe_ecdsa_aes_256_gcm_sha_384,ecdhe_rsa_aes_256_gcm_sha_384,ecdhe_ecdsa_aes_256_sha,ecdhe_ecdsa_aes_128_sha,ecdhe_rsa_aes_128_sha,ecdhe_rsa_aes_256_sha,rsa_aes_128_gcm_sha_256,rsa_aes_256_gcm_sha_384,rsa_aes_128_sha,rsa_aes_256_sha \ -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:95.0) Gecko/20100101 Firefox/95.0' \ -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8' \ diff --git a/firefox/curl_ff98 b/firefox/curl_ff98 old mode 100644 new mode 100755 index 2d15a5c..b9b08d4 --- a/firefox/curl_ff98 +++ b/firefox/curl_ff98 @@ -6,7 +6,7 @@ dir=`echo "$0" | sed 's%/[^/]*$%%'` # The list of ciphers can be obtained by looking at the Client Hello message in # Wireshark, then converting it using the cipherlist array at # https://github.com/curl/curl/blob/master/lib/vtls/nss.c -"$dir/curl-impersonate" \ +"$dir/curl-impersonate-ff" \ --ciphers aes_128_gcm_sha_256,chacha20_poly1305_sha_256,aes_256_gcm_sha_384,ecdhe_ecdsa_aes_128_gcm_sha_256,ecdhe_rsa_aes_128_gcm_sha_256,ecdhe_ecdsa_chacha20_poly1305_sha_256,ecdhe_rsa_chacha20_poly1305_sha_256,ecdhe_ecdsa_aes_256_gcm_sha_384,ecdhe_rsa_aes_256_gcm_sha_384,ecdhe_ecdsa_aes_256_sha,ecdhe_ecdsa_aes_128_sha,ecdhe_rsa_aes_128_sha,ecdhe_rsa_aes_256_sha,rsa_aes_128_gcm_sha_256,rsa_aes_256_gcm_sha_384,rsa_aes_128_sha,rsa_aes_256_sha \ -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0' \ -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8' \ diff --git a/firefox/patches/curl-impersonate.patch b/firefox/patches/curl-impersonate.patch index 490c87f..cb6e364 100644 --- a/firefox/patches/curl-impersonate.patch +++ b/firefox/patches/curl-impersonate.patch @@ -1,5 +1,25 @@ +diff --git a/Makefile.am b/Makefile.am +index 3e55230ee..90b504b5c 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -192,13 +192,13 @@ CLEANFILES = $(VC6_LIBDSP) $(VC6_SRCDSP) $(VC7_LIBVCPROJ) $(VC7_SRCVCPROJ) \ + $(VC11_LIBVCXPROJ) $(VC11_SRCVCXPROJ) $(VC12_LIBVCXPROJ) $(VC12_SRCVCXPROJ) \ + $(VC14_LIBVCXPROJ) $(VC14_SRCVCXPROJ) $(VC15_LIBVCXPROJ) $(VC15_SRCVCXPROJ) + +-bin_SCRIPTS = curl-config ++bin_SCRIPTS = curl-impersonate-ff-config + + SUBDIRS = lib src + DIST_SUBDIRS = $(SUBDIRS) tests packages scripts include docs + + pkgconfigdir = $(libdir)/pkgconfig +-pkgconfig_DATA = libcurl.pc ++pkgconfig_DATA = libcurl-impersonate-ff.pc + + # List of files required to generate VC IDE .dsp, .vcproj and .vcxproj files + include lib/Makefile.inc diff --git a/configure.ac b/configure.ac -index 63e320236..5870fa430 100644 +index 63e320236..238addfaa 100644 --- a/configure.ac +++ b/configure.ac @@ -1331,7 +1331,8 @@ if test X"$OPT_BROTLI" != Xno; then @@ -44,6 +64,42 @@ index 63e320236..5870fa430 100644 AC_MSG_NOTICE([-L is $LD_H2]) LDFLAGS="$LDFLAGS $LD_H2" +@@ -4255,8 +4260,8 @@ AC_CONFIG_FILES([Makefile \ + tests/unit/Makefile \ + packages/Makefile \ + packages/vms/Makefile \ +- curl-config \ +- libcurl.pc ++ curl-impersonate-ff-config:curl-config.in \ ++ libcurl-impersonate-ff.pc:libcurl.pc.in + ]) + AC_OUTPUT + +diff --git a/curl-config.in b/curl-config.in +index 8b4a29a9a..2c8b888d8 100644 +--- a/curl-config.in ++++ b/curl-config.in +@@ -161,9 +161,9 @@ while test $# -gt 0; do + CURLLIBDIR="" + fi + if test "X@ENABLE_SHARED@" = "Xno"; then +- echo ${CURLLIBDIR}-lcurl @LIBCURL_LIBS@ ++ echo ${CURLLIBDIR}-lcurl-impersonate-ff @LIBCURL_LIBS@ + else +- echo ${CURLLIBDIR}-lcurl ++ echo ${CURLLIBDIR}-lcurl-impersonate-ff + fi + ;; + --ssl-backends) +@@ -172,7 +172,7 @@ while test $# -gt 0; do + + --static-libs) + if test "X@ENABLE_STATIC@" != "Xno" ; then +- echo @libdir@/libcurl.@libext@ @LDFLAGS@ @LIBCURL_LIBS@ ++ echo @libdir@/libcurl-impersonate-ff.@libext@ @LDFLAGS@ @LIBCURL_LIBS@ + else + echo "curl was built with static libraries disabled" >&2 + exit 1 diff --git a/include/curl/curl.h b/include/curl/curl.h index 7b69ce2d6..fe4bb36b9 100644 --- a/include/curl/curl.h @@ -79,6 +135,86 @@ index 2dbfb26b5..e0bf86169 100644 /* * NAME curl_easy_getinfo() * +diff --git a/lib/Makefile.am b/lib/Makefile.am +index 769363941..6e2f1b829 100644 +--- a/lib/Makefile.am ++++ b/lib/Makefile.am +@@ -32,7 +32,7 @@ EXTRA_DIST = Makefile.m32 config-win32.h config-win32ce.h \ + firefox-db2pem.sh config-vxworks.h Makefile.vxworks checksrc.pl \ + setup-win32.h .checksrc + +-lib_LTLIBRARIES = libcurl.la ++lib_LTLIBRARIES = libcurl-impersonate-ff.la + + if BUILD_UNITTESTS + noinst_LTLIBRARIES = libcurlu.la +@@ -84,43 +84,43 @@ AM_CPPFLAGS += -DBUILDING_LIBCURL + AM_LDFLAGS = + AM_CFLAGS = + +-libcurl_la_CPPFLAGS_EXTRA = +-libcurl_la_LDFLAGS_EXTRA = +-libcurl_la_CFLAGS_EXTRA = ++libcurl_impersonate_ff_la_CPPFLAGS_EXTRA = ++libcurl_impersonate_ff_la_LDFLAGS_EXTRA = ++libcurl_impersonate_ff_la_CFLAGS_EXTRA = + + if CURL_LT_SHLIB_USE_VERSION_INFO +-libcurl_la_LDFLAGS_EXTRA += $(VERSIONINFO) ++libcurl_impersonate_ff_la_LDFLAGS_EXTRA += $(VERSIONINFO) + endif + + if CURL_LT_SHLIB_USE_NO_UNDEFINED +-libcurl_la_LDFLAGS_EXTRA += -no-undefined ++libcurl_impersonate_ff_la_LDFLAGS_EXTRA += -no-undefined + endif + + if CURL_LT_SHLIB_USE_MIMPURE_TEXT +-libcurl_la_LDFLAGS_EXTRA += -mimpure-text ++libcurl_impersonate_ff_la_LDFLAGS_EXTRA += -mimpure-text + endif + + if CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS +-libcurl_la_LDFLAGS_EXTRA += -Wl,--version-script=libcurl.vers ++libcurl_impersonate_ff_la_LDFLAGS_EXTRA += -Wl,--version-script=libcurl.vers + else + # if symbol-hiding is enabled, hide them! + if DOING_CURL_SYMBOL_HIDING +-libcurl_la_LDFLAGS_EXTRA += -export-symbols-regex '^curl_.*' ++libcurl_impersonate_ff_la_LDFLAGS_EXTRA += -export-symbols-regex '^curl_.*' + endif + endif + + if USE_CPPFLAG_CURL_STATICLIB +-libcurl_la_CPPFLAGS_EXTRA += -DCURL_STATICLIB ++libcurl_impersonate_ff_la_CPPFLAGS_EXTRA += -DCURL_STATICLIB + endif + + if DOING_CURL_SYMBOL_HIDING +-libcurl_la_CPPFLAGS_EXTRA += -DCURL_HIDDEN_SYMBOLS +-libcurl_la_CFLAGS_EXTRA += $(CFLAG_CURL_SYMBOL_HIDING) ++libcurl_impersonate_ff_la_CPPFLAGS_EXTRA += -DCURL_HIDDEN_SYMBOLS ++libcurl_impersonate_ff_la_CFLAGS_EXTRA += $(CFLAG_CURL_SYMBOL_HIDING) + endif + +-libcurl_la_CPPFLAGS = $(AM_CPPFLAGS) $(libcurl_la_CPPFLAGS_EXTRA) +-libcurl_la_LDFLAGS = $(AM_LDFLAGS) $(libcurl_la_LDFLAGS_EXTRA) $(LDFLAGS) $(LIBCURL_LIBS) +-libcurl_la_CFLAGS = $(AM_CFLAGS) $(libcurl_la_CFLAGS_EXTRA) ++libcurl_impersonate_ff_la_CPPFLAGS = $(AM_CPPFLAGS) $(libcurl_impersonate_ff_la_CPPFLAGS_EXTRA) ++libcurl_impersonate_ff_la_LDFLAGS = $(AM_LDFLAGS) $(libcurl_impersonate_ff_la_LDFLAGS_EXTRA) $(LDFLAGS) $(LIBCURL_LIBS) ++libcurl_impersonate_ff_la_CFLAGS = $(AM_CFLAGS) $(libcurl_impersonate_ff_la_CFLAGS_EXTRA) + + libcurlu_la_CPPFLAGS = $(AM_CPPFLAGS) -DCURL_STATICLIB -DUNITTESTS + libcurlu_la_LDFLAGS = $(AM_LDFLAGS) -static $(LIBCURL_LIBS) +@@ -129,7 +129,7 @@ libcurlu_la_CFLAGS = $(AM_CFLAGS) + # Makefile.inc provides the CSOURCES and HHEADERS defines + include Makefile.inc + +-libcurl_la_SOURCES = $(CSOURCES) $(HHEADERS) ++libcurl_impersonate_ff_la_SOURCES = $(CSOURCES) $(HHEADERS) + libcurlu_la_SOURCES = $(CSOURCES) $(HHEADERS) + + CHECKSRC = $(CS_$(V)) diff --git a/lib/easy.c b/lib/easy.c index 20293a710..b97ac204e 100644 --- a/lib/easy.c @@ -800,6 +936,18 @@ index 2b44f0512..4c60797c7 100644 if(SSL_SetNextProtoNego(backend->handle, protocols, cur) != SECSuccess) goto error; +diff --git a/libcurl.pc.in b/libcurl.pc.in +index 8ac15d407..68d01b219 100644 +--- a/libcurl.pc.in ++++ b/libcurl.pc.in +@@ -34,6 +34,6 @@ Name: libcurl + URL: https://curl.se/ + Description: Library to transfer files with ftp, http, etc. + Version: @CURLVERSION@ +-Libs: -L${libdir} -lcurl @LIBCURL_NO_SHARED@ ++Libs: -L${libdir} -lcurl-impersonate-ff @LIBCURL_NO_SHARED@ + Libs.private: @LIBCURL_LIBS@ + Cflags: -I${includedir} @CPPFLAG_CURL_STATICLIB@ diff --git a/m4/curl-nss.m4 b/m4/curl-nss.m4 index 397ba71b1..abc09a91c 100644 --- a/m4/curl-nss.m4 @@ -822,3 +970,37 @@ index 397ba71b1..abc09a91c 100644 [ AC_DEFINE(USE_NSS, 1, [if NSS is enabled]) AC_SUBST(USE_NSS, [1]) +diff --git a/src/Makefile.am b/src/Makefile.am +index c8abc93b1..fcecb10d0 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -41,7 +41,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \ + -I$(top_srcdir)/lib \ + -I$(top_srcdir)/src + +-bin_PROGRAMS = curl ++bin_PROGRAMS = curl-impersonate-ff + + SUBDIRS = ../docs + +@@ -52,7 +52,7 @@ endif + include Makefile.inc + + # CURL_FILES comes from Makefile.inc +-curl_SOURCES = $(CURL_FILES) ++curl_impersonate_ff_SOURCES = $(CURL_FILES) + + # This might hold -Werror + CFLAGS += @CURL_CFLAG_EXTRAS@ +@@ -61,9 +61,9 @@ CFLAGS += @CURL_CFLAG_EXTRAS@ + LIBS = $(BLANK_AT_MAKETIME) + + if USE_EXPLICIT_LIB_DEPS +-curl_LDADD = $(top_builddir)/lib/libcurl.la @LIBCURL_LIBS@ ++curl_impersonate_ff_LDADD = $(top_builddir)/lib/libcurl-impersonate-ff.la @LIBCURL_LIBS@ + else +-curl_LDADD = $(top_builddir)/lib/libcurl.la @NSS_LIBS@ @SSL_LIBS@ @ZLIB_LIBS@ @CURL_NETWORK_AND_TIME_LIBS@ ++curl_impersonate_ff_LDADD = $(top_builddir)/lib/libcurl-impersonate-ff.la @NSS_LIBS@ @SSL_LIBS@ @ZLIB_LIBS@ @CURL_NETWORK_AND_TIME_LIBS@ + endif + + # if unit tests are enabled, build a static library to link them with