mirror of
https://github.com/lwthiker/curl-impersonate.git
synced 2026-09-08 01:41:52 +00:00
Merge branch 'main' into upgrade_curl_to_8_1_1
This commit is contained in:
@@ -33,6 +33,11 @@ jobs:
|
||||
host: aarch64-linux-gnu
|
||||
capture_interface: eth0
|
||||
make: make
|
||||
- os: ubuntu-20.04
|
||||
arch: arm
|
||||
host: arm-linux-gnueabihf
|
||||
capture_interface: eth0
|
||||
make: make
|
||||
- os: macos-11
|
||||
arch: x86_64
|
||||
host: x86_64-macos
|
||||
@@ -55,10 +60,10 @@ jobs:
|
||||
# More dependencies for the tests
|
||||
sudo apt-get install tcpdump nghttp2-server libnss3
|
||||
|
||||
- name: Install Ubuntu dependencies (aarch64)
|
||||
if: matrix.arch == 'aarch64'
|
||||
- name: Install Ubuntu cross-compile dependencies (${{ matrix.arch }})
|
||||
if: matrix.os == 'ubuntu-20.04' && matrix.arch != 'x86_64'
|
||||
run: |
|
||||
sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
|
||||
sudo apt-get install gcc-${{ matrix.host }} g++-${{ matrix.host }}
|
||||
|
||||
- name: Install macOS dependencies
|
||||
if: matrix.os == 'macos-11'
|
||||
@@ -177,7 +182,7 @@ jobs:
|
||||
${{ matrix.make }} firefox-build
|
||||
${{ matrix.make }} firefox-checkbuild
|
||||
${{ matrix.make }} firefox-install
|
||||
|
||||
|
||||
- name: Prepare the tests
|
||||
if: matrix.arch == 'x86_64'
|
||||
run: |
|
||||
@@ -250,4 +255,4 @@ jobs:
|
||||
with:
|
||||
files: |
|
||||
${{ env.release_file_lib }}
|
||||
${{ env.release_file_bin }}
|
||||
${{ env.release_file_bin }}
|
||||
@@ -98,6 +98,12 @@ pip3 install gyp-next
|
||||
brew install go
|
||||
```
|
||||
|
||||
Clone this repository:
|
||||
```
|
||||
git clone https://github.com/lwthiker/curl-impersonate.git
|
||||
cd curl-impersonate
|
||||
```
|
||||
|
||||
Configure and compile:
|
||||
```
|
||||
mkdir build && cd build
|
||||
|
||||
@@ -225,6 +225,7 @@ else
|
||||
;; \
|
||||
*) \
|
||||
use_64="0"; \
|
||||
nspr_configure_flags=""; \
|
||||
;; \
|
||||
esac
|
||||
|
||||
|
||||
+4
-4
@@ -5,12 +5,12 @@ Since it is just a modified curl build, all the original flags and command line
|
||||
|
||||
For example, the Firefox version can be run as follows:
|
||||
```bash
|
||||
curl-impersonate-ff -v -L httsp://wikipedia.org
|
||||
curl-impersonate-ff -v -L https://wikipedia.org
|
||||
```
|
||||
|
||||
and the Chrome version:
|
||||
```bash
|
||||
curl-impersonate-chrome -v -L httsp://wikipedia.org
|
||||
curl-impersonate-chrome -v -L https://wikipedia.org
|
||||
```
|
||||
|
||||
However, by default, running the binaries as above will not prdouce the same TLS and HTTP/2 signatures as the impersonated browsers. Rather, this project provides additional *wrapper scripts* that launch these binaries with the correct set of command line flags to produce the desired signatures. For example:
|
||||
@@ -62,11 +62,11 @@ The important flags are as follows:
|
||||
* `--tlsv1.2` sets the minimal TLS version, which is part of the TLS client hello message, to TLS1.2.
|
||||
* `--no-npn` disables to NPN TLS extension.
|
||||
* `--alps` enables the ALPS TLS extension. This flag was added for this project.
|
||||
* `--cert-compression` enables TLS certificate compression used by Chrome. This flag was added for this project.
|
||||
* `--cert-compression` enables TLS certificate compression used by Chrome. This flag was added for this project.
|
||||
|
||||
## Flags that modify the TLS signature
|
||||
|
||||
The following flags are known to affect the TLS signature of curl.
|
||||
Using them in addition to the flags in the wrapper scripts may produce a signature that does not match the browser.
|
||||
|
||||
`--ciphers`, `--curves`, `--no-npn`, `--no-alpn`, `--tls-max`, `--tls13-ciphers`, `--tlsv1.0`, `--tlsv1.1`, `--tlsv1.2`, `--tlsv1.3`, `--tlsv1`
|
||||
`--ciphers`, `--curves`, `--no-npn`, `--no-alpn`, `--tls-max`, `--tls13-ciphers`, `--tlsv1.0`, `--tlsv1.1`, `--tlsv1.2`, `--tlsv1.3`, `--tlsv1`
|
||||
|
||||
@@ -1565,7 +1565,7 @@ index 9db6b0f89..9e2f19af9 100644
|
||||
Libs.private: @LIBCURL_LIBS@
|
||||
Cflags: -I${includedir} @CPPFLAG_CURL_STATICLIB@
|
||||
diff --git a/m4/curl-nss.m4 b/m4/curl-nss.m4
|
||||
index 2916c3613..9da97ff3c 100644
|
||||
index 2916c3613..3b43b2dfc 100644
|
||||
--- a/m4/curl-nss.m4
|
||||
+++ b/m4/curl-nss.m4
|
||||
@@ -76,7 +76,123 @@ if test "x$OPT_NSS" != xno; then
|
||||
@@ -1603,7 +1603,7 @@ index 2916c3613..9da97ff3c 100644
|
||||
+
|
||||
+ case $host_cpu in
|
||||
+ arm)
|
||||
+ addlib="$addlib -larmv8_c_lib"
|
||||
+ addlib="$addlib -larmv8_c_lib -llibgcm-aes-arm32-neon_c_lib"
|
||||
+ ;;
|
||||
+ aarch64)
|
||||
+ addlib="$addlib -larmv8_c_lib -lgcm-aes-aarch64_c_lib"
|
||||
|
||||
Reference in New Issue
Block a user