What is the purpose of configuring SSL protocols in nginx?
Configuring SSL protocols in nginx controls which versions of SSL/TLS are allowed for secure connections. This helps improve security by disabling outdated or vulnerable protocols.
Click to reveal answer
beginner
What does the ssl_protocols directive do in nginx?
The ssl_protocols directive specifies which SSL/TLS protocol versions nginx will accept for HTTPS connections, such as TLSv1.2 and TLSv1.3.
Click to reveal answer
intermediate
Why is it important to configure cipher suites in nginx?
Cipher suites determine the encryption algorithms used during SSL/TLS connections. Configuring them ensures strong encryption and prevents weak or vulnerable ciphers from being used.
Click to reveal answer
intermediate
What is the effect of this nginx directive? ssl_ciphers 'HIGH:!aNULL:!MD5';
This directive tells nginx to use only strong ciphers (HIGH), exclude anonymous authentication ciphers (!aNULL), and exclude ciphers using MD5 hashing (!MD5), improving security.
Click to reveal answer
beginner
How can you disable SSLv3 and TLSv1.0 in nginx?
By setting ssl_protocols TLSv1.2 TLSv1.3; in the nginx configuration, you disable SSLv3 and TLSv1.0, allowing only TLS 1.2 and 1.3 protocols.
Click to reveal answer
Which nginx directive controls the SSL/TLS protocol versions allowed?
Assl_protocols
Bssl_ciphers
Cssl_certificate
Dssl_session_cache
✗ Incorrect
The ssl_protocols directive sets which SSL/TLS versions nginx accepts.
What does the exclamation mark (!) mean in the ssl_ciphers directive?
ASet cipher priority
BInclude the cipher
CExclude the cipher
DEnable anonymous ciphers
✗ Incorrect
The exclamation mark excludes the specified cipher from the list.
Which SSL/TLS protocols are recommended to enable in nginx for best security?
ATLSv1.2 and TLSv1.3
BSSLv3 and TLSv1.0
CTLSv1.0 and TLSv1.1
DSSLv2 and SSLv3
✗ Incorrect
TLSv1.2 and TLSv1.3 are modern and secure protocols recommended for use.
What is the main risk of allowing weak ciphers in SSL configuration?
ASlower connection speed
BIncreased server load
CCompatibility issues with browsers
DSecurity vulnerabilities and data breaches
✗ Incorrect
Weak ciphers can be exploited, leading to security breaches.
How do you specify multiple protocols in the ssl_protocols directive?
ASeparate by commas
BSeparate by spaces
CUse semicolons
DUse colons
✗ Incorrect
Protocols are listed separated by spaces, e.g., ssl_protocols TLSv1.2 TLSv1.3;
Explain how to configure nginx to use only TLS 1.2 and TLS 1.3 protocols and strong cipher suites.
Think about which protocols to allow and how to exclude weak ciphers.
You got /3 concepts.
Describe why disabling older SSL protocols like SSLv3 is important in nginx SSL configuration.
Consider the risks of outdated encryption methods.
You got /3 concepts.
Practice
(1/5)
1. What is the purpose of the ssl_protocols directive in an nginx configuration?
easy
A. To specify which SSL/TLS protocol versions are allowed for secure connections
B. To define the encryption algorithms used for data compression
C. To set the maximum size of SSL certificates
D. To enable HTTP/2 support over SSL
Solution
Step 1: Understand the role of ssl_protocols
The ssl_protocols directive controls which SSL/TLS versions nginx will accept for secure connections.
Step 2: Compare options with this role
Only To specify which SSL/TLS protocol versions are allowed for secure connections correctly describes this purpose; others mention unrelated features like compression or HTTP/2.
Final Answer:
To specify which SSL/TLS protocol versions are allowed for secure connections -> Option A
2. Which of the following is the correct syntax to enable only TLSv1.2 and TLSv1.3 in nginx?
easy
A. ssl_protocols tlsv12 tlsv13;
B. ssl_protocols tls1.2 tls1.3;
C. ssl_protocols TLSv1.2 TLSv1.3;
D. ssl_protocols TLS1_2 TLS1_3;
Solution
Step 1: Recall correct nginx ssl_protocols syntax
The correct syntax uses capitalized TLS versions separated by spaces, ending with a semicolon, e.g., ssl_protocols TLSv1.2 TLSv1.3;.
Step 2: Check each option's format
ssl_protocols TLSv1.2 TLSv1.3; matches the correct syntax exactly. Options A, B, and C use incorrect casing or underscores, which nginx does not accept.
When set to on, nginx forces the server's cipher preference to override the client's during SSL handshake.
Step 2: Analyze options
Server forces selection of its preferred cipher from the client's list correctly states the server enforces its cipher choice from the client's offered list. Client chooses the cipher from its list ignoring server preference is the opposite. Cipher selection is random between client and server lists is incorrect as selection is not random. SSL handshake fails if client and server ciphers differ is false; handshake does not fail just because of differing preferences.
Final Answer:
Server forces selection of its preferred cipher from the client's list -> Option D
Quick Check:
ssl_prefer_server_ciphers on = Server cipher priority [OK]
Hint: ssl_prefer_server_ciphers on means server picks cipher [OK]
But nginx fails to start. What is the likely cause?
medium
A. Missing semicolons at the end of directives
B. Using unsupported TLS versions
C. Incorrect cipher string syntax
D. ssl_prefer_server_ciphers must be off
Solution
Step 1: Check syntax of nginx directives
Each directive must end with a semicolon. The given config lines miss semicolons at the end.
Step 2: Validate other options
TLS versions and cipher strings are valid. ssl_prefer_server_ciphers can be on. So the syntax error (missing semicolons) causes nginx to fail.
Final Answer:
Missing semicolons at the end of directives -> Option A
Quick Check:
Missing semicolons cause config errors [OK]
Hint: Always end nginx directives with semicolon [OK]
Common Mistakes:
Ignoring semicolon syntax errors
Assuming TLS versions are unsupported
Thinking ssl_prefer_server_ciphers must be off
5. You want to configure nginx to only allow TLSv1.3 and use strong ciphers, but also ensure clients that do not support TLSv1.3 can still connect securely using TLSv1.2. Which configuration snippet achieves this best?
hard
A. ssl_protocols TLSv1.3;
ssl_ciphers TLS_AES_256_GCM_SHA384;
ssl_prefer_server_ciphers on;
B. ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers TLS_AES_256_GCM_SHA384:HIGH:!aNULL;
ssl_prefer_server_ciphers on;
C. ssl_protocols TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers off;
D. ssl_protocols TLSv1.3 TLSv1.1;
ssl_ciphers HIGH:!aNULL;
ssl_prefer_server_ciphers on;
Solution
Step 1: Identify required TLS versions
We want to allow TLSv1.3 and TLSv1.2 to support clients without TLSv1.3.
Step 2: Check cipher configuration
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers TLS_AES_256_GCM_SHA384:HIGH:!aNULL;
ssl_prefer_server_ciphers on; includes TLS_AES_256_GCM_SHA384 (a strong TLSv1.3 cipher) plus HIGH strength ciphers for TLSv1.2, with server cipher preference enabled.