mirror of
https://github.com/lwthiker/curl-impersonate.git
synced 2025-08-10 10:49:26 +00:00
Add automated tests to verify curl's TLS signature
Add automated testing infrastructure with tests verifying that `curl-impersonate` has the same TLS signature as that of the impersonated browser. Each wrapper script (e.g. curl_chrome98) is launched to wikipedia.org while a packet capture is running in the background. The Client Hello is extracted from the capture, parsed and then compared to the known browser signature. The known signatures are stored in a YAML database.
This commit is contained in:
21
tests/Dockerfile
Normal file
21
tests/Dockerfile
Normal file
@@ -0,0 +1,21 @@
|
||||
FROM python:3.10.1-slim-buster
|
||||
|
||||
WORKDIR /tests
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y tcpdump libbrotli1 libnss3
|
||||
|
||||
COPY requirements.txt requirements.txt
|
||||
|
||||
RUN pip install --upgrade pip && \
|
||||
pip install -r requirements.txt
|
||||
|
||||
RUN mkdir /tests/firefox /tests/chrome
|
||||
|
||||
# Copy the built binaries from both containers
|
||||
COPY --from=curl-impersonate-ff /build/out/* /tests/firefox/
|
||||
COPY --from=curl-impersonate-chrome /build/out/* /tests/chrome/
|
||||
|
||||
COPY . .
|
||||
|
||||
ENTRYPOINT ["pytest"]
|
Reference in New Issue
Block a user