Skip to content

Commit ec4e8a5

Browse files
authored
TLS benchmarks: include nginx TLS connections job (#2123)
* nginx docker tls handshakes * move maybe works? * try use 5000 port everywhere
1 parent f5d8853 commit ec4e8a5

File tree

5 files changed

+53
-25
lines changed

5 files changed

+53
-25
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: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ jobs:
6868
dockerFile: dockerNginx/src/BenchmarksApps/TLS/Nginx/Dockerfile
6969
dockerImageName: dockerNginx
7070
dockerContextDirectory: dockerNginx/src/BenchmarksApps/TLS
71-
port: 8080
71+
port: 5000
7272
readyStateText: Application started.
7373
environmentVariables:
74-
urls: "https://*:8080" # any ip, port 8080
74+
urls: "https://*:5000" # any ip, port 8080
7575

7676
scenarios:
7777

@@ -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+
presetHeaders: connectionclose
146+
connections: 32
147+
serverScheme: https
148+
sslProtocol: tls12
149+
serverPort: 5000
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
Lines changed: 25 additions & 3 deletions
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,11 +14,30 @@ 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

17-
# Expose port 8080 for HTTPS traffic
18-
EXPOSE 8080
39+
# Expose port 5000 for HTTPS traffic
40+
EXPOSE 5000
1941

2042
# Run the startup script
2143
CMD ["/start-nginx.sh"]

src/BenchmarksApps/TLS/Nginx/config/nginx.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ http {
1818
access_log off;
1919

2020
server {
21-
listen 8080 ssl;
22-
listen [::]:8080 ssl;
21+
listen 5000 ssl;
22+
listen [::]:5000 ssl;
2323
server_name YOUR_IP;
2424

2525
ssl_certificate /etc/nginx/certs/cert.pem;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
curl -v https://127.0.0.1:8080 --insecure
1+
curl -v https://127.0.0.1:5000 --insecure

0 commit comments

Comments
 (0)