@@ -50,12 +50,10 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --fix-missing \
5050 zlib1g-dev
5151
5252# Create build directory
53- RUN mkdir -p /build
53+ RUN mkdir -p /build/nginx-ssl-ja3
5454
5555WORKDIR /build
5656
57- VOLUME ["/build/nginx-ssl-ja3" ]
58-
5957# Get test framework
6058RUN git clone https://github.com/nginx/nginx-tests
6159
@@ -66,7 +64,7 @@ RUN git clone https://github.com/openssl/openssl
6664WORKDIR /build/openssl
6765
6866RUN git checkout OpenSSL_1_1_1 -b patched
69- COPY patches/openssl.extensions.patch /build/openssl
67+ COPY nginx-ja3/ patches/openssl.extensions.patch /build/openssl
7068RUN patch -p1 < openssl.extensions.patch
7169RUN ./config -d
7270RUN make
@@ -78,28 +76,38 @@ RUN hg clone http://hg.nginx.org/nginx
7876
7977# Patch nginx for fetching ssl client extensions
8078WORKDIR /build/nginx
81- COPY patches/nginx.latest.patch /build/nginx
79+ COPY nginx-ja3/ patches/nginx.latest.patch /build/nginx
8280RUN patch -p1 < nginx.latest.patch
8381
8482# Install files
8583RUN mkdir -p /usr/local/nginx/conf/
86- COPY docker/debian-nginx-ssl-ja3/nginx.conf /usr/local/nginx/conf/nginx.conf
8784
8885# Install self-signed certificate
8986RUN LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib /usr/local/bin/openssl req -new -x509 -days 365 -nodes -out /usr/local/nginx/conf/cert.pem -keyout /usr/local/nginx/conf/rsa.key -subj "/C=PT/ST=Lisbon/L=Lisbon/O=Development/CN=foo.local"
9087
9188# vim config
92- COPY docker/debian- nginx-ssl-ja3 /vimrc /etc/vim/vimrc
89+ COPY ./ nginx/vimrc /etc/vim/vimrc
9390
9491RUN echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib' | tee -a /root/.bashrc
9592RUN echo 'export PATH=$PATH:/usr/local/bin:/usr/local/nginx/sbin' | tee -a /root/.bashrc
9693RUN echo '' | tee -a /root/.bashrc
9794RUN echo 'export ASAN_OPTIONS=symbolize=1' | tee -a /root/.bashrc
98- RUN echo 'export export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer' | tee -a /root/.bashrc
95+ RUN echo 'export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer' | tee -a /root/.bashrc
9996RUN echo '' | tee -a /root/.bashrc
10097
101- WORKDIR /build
102- COPY docker/debian-nginx-ssl-ja3/compile.sh /build/compile.sh
103- RUN echo 'TO COMPILE RUN:\n cd nginx\n ASAN_OPTIONS=symbolize=1 ./auto/configure --add-module=/build/nginx-ssl-ja3 --with-http_ssl_module --with-stream_ssl_module --with-debug --with-stream --with-cc-opt="-fsanitize=address -O -fno-omit-frame-pointer" --with-ld-opt="-L/usr/local/lib -Wl,-E -lasan"\n make install' | tee -a /build/COMPILE.ASAN.README
104- RUN echo 'TO TEST RUN:\n nginx &\n openssl s_client -connect 127.0.0.1:12345 -cipher "AES128-SHA" -curves secp521r1' | tee -a /build/TEST.README
98+ COPY nginx-ja3/ /build/nginx-ssl-ja3
10599
100+ WORKDIR /build/nginx
101+ RUN ASAN_OPTIONS=detect_leaks=0:symbolize=1 ./auto/configure \
102+ --add-module=/build/nginx-ssl-ja3 \
103+ --with-http_ssl_module \
104+ --with-stream_ssl_module \
105+ --with-debug \
106+ --with-stream \
107+ --with-http_auth_request_module \
108+ --with-cc-opt="-fsanitize=address -O -fno-omit-frame-pointer" \
109+ --with-ld-opt="-L/usr/local/lib -Wl,-E -lasan"
110+ RUN make install
111+
112+ EXPOSE 443
113+ CMD ["/usr/local/nginx/sbin/nginx" ]
0 commit comments