Files
curl-impersonate/tests
lwthiker f9afe9cf63 Add wrapper script to impersonate Safari 15.3
Add a new wrapper script that impersonates Safari 15.3 on MacOS 11.6.4
("Big Sur"). The wrapper script uses command line arguments
previously added to "curl-impersonate" for that purpose:
* --curves
* --signature-hashes
* --no-tls-session-ticket
* --http2-pseudo-headers-order
2022-03-03 16:16:13 +02:00
..
2022-02-27 23:21:00 +02:00
2022-02-27 23:21:00 +02:00

The tests verify that curl-impersonate has the same network signature as that of the supported browsers. They do not test curl's functionality itself.

Running the tests

The tests assume that you've built both curl-impersonate-chrome and curl-impersonate-ff docker images before (see Installation).

To run the tests, build with:

docker build -t curl-impersonate-tests tests/

then run with:

docker run --rm curl-impersonate-tests

This simply runs pytest in the container. You can pass additional flags to pytest such as --log-cli-level DEBUG.

How the tests work

For each supported browser, a packet capture is started while curl-impersonate is run with the relevant wrapper script. The Client Hello message is extracted from the capture, and compared against the known signature of the browser.

What's missing

The following tests are still missing:

  • Test that curl-impersonate sends the HTTP headers in the same order as the browser.
  • Test that curl-impersonate sends the HTTP/2 pseudo-headers in the same order as the browser.
  • Test that curl-impersonate sends the same HTTP/2 SETTINGS as the browser.