Challenge - 5 Problems
SNI Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Nginx SNI Configuration Output
Given the following Nginx server block configuration for two domains using SNI, what will be the output of
curl -v https://site1.example.com assuming both certificates are valid and correctly installed?Nginx
server {
listen 443 ssl;
server_name site1.example.com;
ssl_certificate /etc/nginx/ssl/site1.crt;
ssl_certificate_key /etc/nginx/ssl/site1.key;
}
server {
listen 443 ssl;
server_name site2.example.com;
ssl_certificate /etc/nginx/ssl/site2.crt;
ssl_certificate_key /etc/nginx/ssl/site2.key;
}Attempts:
2 left
💡 Hint
Remember that SNI allows the server to present the correct certificate based on the requested domain name.
✗ Incorrect
With SNI enabled, Nginx selects the correct SSL certificate based on the domain requested by the client. Since the request is for site1.example.com, Nginx presents the site1 certificate, allowing a successful SSL handshake.
❓ Configuration
intermediate2:00remaining
Correct Nginx SNI Server Block for Multiple Domains
Which of the following Nginx server block configurations correctly enables SNI for two domains with separate SSL certificates on the same IP and port?
Attempts:
2 left
💡 Hint
Each domain needs its own server block with its own SSL certificate and key.
✗ Incorrect
Option C correctly defines two separate server blocks listening on port 443 with SSL enabled, each with its own domain name and matching SSL certificate and key. This setup enables SNI to serve the correct certificate per domain.
❓ Troubleshoot
advanced2:00remaining
Diagnosing SSL Certificate Mismatch with SNI
A user reports that when accessing https://example.com, the browser shows a certificate warning for a different domain. The Nginx config has multiple server blocks with SSL certificates for different domains. What is the most likely cause?
Attempts:
2 left
💡 Hint
Check which server block Nginx uses when no exact server_name match is found.
✗ Incorrect
If no server block matches the requested domain, Nginx uses the default server block, which may have a certificate for another domain, causing a mismatch warning. Explicitly defining a server block for example.com fixes this.
🔀 Workflow
advanced2:00remaining
Steps to Enable SNI for Multiple SSL Sites on Nginx
What is the correct order of steps to enable SNI for multiple SSL sites on a single Nginx server?
Attempts:
2 left
💡 Hint
Think about the logical order from obtaining certificates to applying configuration.
✗ Incorrect
First, you must have certificates (step 1), then configure server blocks (step 2), enable SSL listening (step 3), and finally reload Nginx (step 4) to activate the setup.
✅ Best Practice
expert2:00remaining
Best Practice for Managing Multiple SSL Certificates with SNI
Which practice is best to ensure smooth management and security when using SNI with multiple SSL certificates on Nginx?
Attempts:
2 left
💡 Hint
Think about security and automation for multiple certificates.
✗ Incorrect
Storing certificates securely and automating renewal reduces human error and improves security. Using Certbot or similar tools helps keep certificates up to date without manual intervention.