Skip to content

Commit 43bb0c4

Browse files
committed
nginx docker tls handshakes
1 parent f5d8853 commit 43bb0c4

File tree

3 files changed

+46
-18
lines changed

3 files changed

+46
-18
lines changed

build/trend-scenarios.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ parameters:
113113

114114
- displayName: "Kestrel Linux: TLS Handshakes"
115115
arguments: --scenario tls-handshakes-kestrel $(tlsJobs) --property scenario=KestrelTLSHandshakes --application.options.requiredOperatingSystem linux
116-
116+
117+
- displayName: "Nginx: TLS Handshakes"
118+
arguments: --scenario tls-handshakes-nginx $(tlsJobs) --property scenario=NginxTLSHandshakes --application.options.requiredOperatingSystem linux
119+
117120
- displayName: "Kestrel Linux: mTLS Handshakes"
118121
arguments: --scenario mTls-handshakes-kestrel $(tlsJobs) --property scenario=KestrelMutualTLSHandshakes --application.options.requiredOperatingSystem linux
119122

scenarios/tls.benchmarks.yml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,24 @@ scenarios:
130130
certPwd: testPassword
131131
sslProtocol: tls12
132132

133+
# Nginx
134+
135+
tls-handshakes-docker-nginx:
136+
application:
137+
job: dockerLinuxNginxServer
138+
buildArguments:
139+
- CERT_KEY_LENGTH=2048
140+
- ENABLE_FIPS_MODE=true
141+
load:
142+
job: httpclient
143+
variables:
144+
path: /hello-world
145+
serverPort: 8080
146+
presetHeaders: connectionclose
147+
connections: 32
148+
serverScheme: https
149+
sslProtocol: tls12
150+
133151
# Kestrel
134152

135153
tls-handshakes-kestrel:
@@ -253,19 +271,4 @@ scenarios:
253271
presetHeaders: connectionclose
254272
connections: 32
255273
serverScheme: https
256-
sslProtocol: tls12
257-
258-
tls-handshakes-docker-nginx:
259-
application:
260-
job: dockerLinuxNginxServer
261-
buildArguments:
262-
- CERT_KEY_LENGTH=2048
263-
load:
264-
job: httpclient
265-
variables:
266-
path: /hello-world
267-
serverPort: 8080
268-
presetHeaders: connectionclose
269-
connections: 32
270-
serverScheme: https
271-
sslProtocol: tls12
274+
sslProtocol: tls12

src/BenchmarksApps/TLS/Nginx/Dockerfile

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
FROM nginx:latest
22

33
# or 4096 key length
4-
ARG CERT_KEY_LENGTH=2048
4+
ARG CERT_KEY_LENGTH=2048
5+
ARG ENABLE_FIPS_MODE=false
6+
ARG OPENSSL_CIPHER_STRING=TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM_SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256
7+
ARG OPENSSL_GROUPS=P-384:P-256:P-521
58

69
# Copy configuration
710
COPY Nginx/config/nginx.conf /etc/nginx/nginx.conf
@@ -11,6 +14,25 @@ COPY Nginx/config/start-nginx.sh /start-nginx.sh
1114
COPY Certificates/${CERT_KEY_LENGTH}/cert.pem /etc/nginx/certs/cert.pem
1215
COPY Certificates/${CERT_KEY_LENGTH}/key.pem /etc/nginx/certs/key.pem
1316

17+
# Configure OpenSSL for FIPS-compliant cipher suites if $ENABLE_FIPS_MODE
18+
RUN if [ "$ENABLE_FIPS_MODE" = "true" ]; then \
19+
echo "=== FIPS MODE ENABLED - Configuring OpenSSL ===" && \
20+
cat /etc/ssl/openssl.cnf && \
21+
echo "" >> /etc/ssl/openssl.cnf && \
22+
echo "openssl_conf = openssl_init" >> /etc/ssl/openssl.cnf && \
23+
echo "[openssl_init]" >> /etc/ssl/openssl.cnf && \
24+
echo "ssl_conf = ssl_sect" >> /etc/ssl/openssl.cnf && \
25+
echo "[ssl_sect]" >> /etc/ssl/openssl.cnf && \
26+
echo "system_default = system_default_sect" >> /etc/ssl/openssl.cnf && \
27+
echo "[system_default_sect]" >> /etc/ssl/openssl.cnf && \
28+
echo "CipherString = $OPENSSL_CIPHER_STRING" >> /etc/ssl/openssl.cnf && \
29+
echo "Groups = $OPENSSL_GROUPS" >> /etc/ssl/openssl.cnf && \
30+
echo "=== FIPS Configuration Applied ===" && \
31+
tail -15 /etc/ssl/openssl.cnf; \
32+
else \
33+
echo "=== FIPS MODE DISABLED ==="; \
34+
fi
35+
1436
# Make the script executable
1537
RUN chmod +x /start-nginx.sh
1638

0 commit comments

Comments
 (0)