Use TLS Server Name Indication (SNI) to serve different HTTPS certificates for multiple hostnames on one Lighttpd IP address. Enable mod_openssl on the :443 socket, configure a deliberate default certificate, then override ssl.pemfile and ssl.privkey inside a $HTTP["host"] block for each additional hostname.
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
How Lighttpd chooses a certificate
SNI is a TLS extension that lets a client send the hostname it wants during the TLS handshake. Lighttpd reads that name and can select the certificate associated with the hostname before serving the HTTPS request. This is what allows several domains to share one IP address and TCP port 443.
As an Amazon Associate I earn from qualifying purchases.
A shared-IP configuration still needs one certificate at the socket level. That certificate is the fallback for clients that do not send SNI and for SNI names that do not match one of your host conditionals. Choose it deliberately; it should represent the most important site or a certificate that safely explains the mismatch.
The normal arrangement is:
- A
$SERVER["socket"] == ":443"block enables TLS and defines the default certificate. - One
$HTTP["host"]conditional is added for every other hostname. - Each conditional points to the certificate chain and private key for that hostname.
The browser sends the hostname through SNI, Lighttpd selects the matching certificate, and the request then continues through the ordinary virtual-host configuration.
#1 Best Overall
- BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
- EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
- COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
- LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
- WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.
Requirements and planning
Check the Lighttpd version
The official Lighttpd references document the ssl.* directives in mod_openssl from Lighttpd 1.4.46 onward. The separate ssl.privkey directive is documented as available from 1.4.53. Check the installed version before using the examples:
lighttpd -v
If the installed release is older, the key may need to be included in the PEM file instead of being supplied through ssl.privkey. Use the SSL reference that matches the installed release rather than assuming newer inheritance or certificate-refresh behavior exists.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Prepare a hostname-to-certificate map
List every name users can enter, including apex and www variants. A certificate for example.org does not automatically cover www.example.org, and the reverse is also true unless both names are included in the certificate’s Subject Alternative Name (SAN) list.
| Hostname | Certificate file | Private-key file | Configured as |
|---|---|---|---|
default.example |
/etc/lighttpd/ssl/default.example.pem |
/etc/lighttpd/ssl/default.example.key |
Fallback in the :443 socket |
www.example.org |
/etc/lighttpd/ssl/www.example.org/fullchain.pem |
/etc/lighttpd/ssl/www.example.org/privkey.pem |
SNI host conditional |
mail.example.org |
/etc/lighttpd/ssl/mail.example.org/fullchain.pem |
/etc/lighttpd/ssl/mail.example.org/privkey.pem |
SNI host conditional |
Keep private keys readable only by the account that must load them. The Lighttpd process needs read access, but ordinary users should not. Store certificates and keys in a consistent directory layout so renewals do not require rewriting the configuration.
Configure the shared HTTPS socket
1. Load the OpenSSL module
Add mod_openssl to the module list if it is not already loaded:
server.modules += ("mod_openssl")
Do not add a second copy if your distribution already loads the module elsewhere. Duplicate module entries are unnecessary and can make configuration maintenance confusing.
Rank #2
- WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
- AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
- PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
- ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
- COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed
2. Define TLS and the default certificate
Create or edit the HTTPS socket block. The following is the basic Lighttpd pattern:
server.modules += ("mod_openssl")
$SERVER["socket"] == ":443" {
ssl.engine = "enable"
ssl.pemfile = "/etc/lighttpd/ssl/default.example.pem"
ssl.privkey = "/etc/lighttpd/ssl/default.example.key"
}
ssl.engine = "enable" turns on TLS for this socket. ssl.pemfile identifies the certificate material, while ssl.privkey identifies the private key when it is stored separately. The default PEM and key must exist and be readable before Lighttpd can start or reload this configuration.
3. Add a certificate override for each hostname
Place a host conditional for every additional name:
$HTTP["host"] == "www.example.org" {
ssl.pemfile = "/etc/lighttpd/ssl/www.example.org/fullchain.pem"
ssl.privkey = "/etc/lighttpd/ssl/www.example.org/privkey.pem"
}
$HTTP["host"] == "mail.example.org" {
ssl.pemfile = "/etc/lighttpd/ssl/mail.example.org/fullchain.pem"
ssl.privkey = "/etc/lighttpd/ssl/mail.example.org/privkey.pem"
}
Use the exact hostname spelling that appears in the request. If you intend to support both an apex name and a www name, either issue one certificate containing both SANs or create separate host conditionals with the appropriate certificate for each.
Complete example
Combining the socket and conditionals gives a compact multi-certificate configuration:
server.modules += ("mod_openssl")
$SERVER["socket"] == ":443" {
ssl.engine = "enable"
ssl.pemfile = "/etc/lighttpd/ssl/default.example.pem"
ssl.privkey = "/etc/lighttpd/ssl/default.example.key"
}
$HTTP["host"] == "www.example.org" {
ssl.pemfile = "/etc/lighttpd/ssl/www.example.org/fullchain.pem"
ssl.privkey = "/etc/lighttpd/ssl/www.example.org/privkey.pem"
}
$HTTP["host"] == "mail.example.org" {
ssl.pemfile = "/etc/lighttpd/ssl/mail.example.org/fullchain.pem"
ssl.privkey = "/etc/lighttpd/ssl/mail.example.org/privkey.pem"
}
Keep the default certificate in the socket block even when every expected browser sends SNI. It is required for SNI-less clients and is also the certificate a client receives when its requested name has no matching conditional.
Rank #3
- Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
- Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
- Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
- ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
- Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)
Build certificate files correctly
Certificate chain order
ssl.pemfile must contain the server certificate and, when applicable, the intermediate certificates in the correct order. With an ACME-issued certificate, fullchain.pem is normally the appropriate value for ssl.pemfile: it contains the leaf certificate followed by the intermediate chain.
A missing intermediate can produce browser warnings even though the leaf certificate is valid. Do not substitute a CA bundle containing unrelated roots, and do not reverse the order of the leaf and intermediate certificates.
Free tools Windows power users keep installed
One-click scans. No signup required.
Separate or combined private keys
When the private key is not inside the PEM file, specify it with ssl.privkey. The certificate and key must belong together. If they do not match, Lighttpd may fail to start, fail to reload, or present unusable TLS credentials.
Older configurations may place the private key and certificate in one PEM file. That arrangement is different from the separate-file example above; use one consistent format supported by the installed Lighttpd release.
Names must match the request
Certificate validation is based on the requested hostname, not merely on the IP address. Confirm that every certificate’s SAN list contains the exact name users will request, including capitalization-insensitive but otherwise exact labels such as www.example.org versus example.org. A wildcard certificate also has defined scope; for example, a wildcard for *.example.org does not cover the bare example.org name.
Use Let’s Encrypt and handle renewals
Lighttpd’s official how-to documents Certbot and Let’s Encrypt. The documented file mapping uses privkey.pem for ssl.privkey and fullchain.pem for ssl.pemfile. A representative HTTPS socket is:
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Rank #4
- Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
- Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
- 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
- Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
- USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC
server.modules += ("mod_openssl")
$SERVER["socket"] == "0.0.0.0:443" {
ssl.engine = "enable"
ssl.privkey = "/etc/letsencrypt/live/www.example.com/privkey.pem"
ssl.pemfile = "/etc/letsencrypt/live/www.example.com/fullchain.pem"
ssl.openssl.ssl-conf-cmd = ("MinProtocol" => "TLSv1.2")
}
The documented OpenSSL setting establishes TLS 1.2 as the minimum protocol for that example. Apply it only when it matches your compatibility policy and the Lighttpd/OpenSSL versions installed on the server.
HTTP-01 validation requirement
Certbot’s HTTP-01 challenge requires the hostname to answer the challenge on port 80. Ensure DNS points the name to this server, the firewall permits port 80, and Lighttpd (or the validation setup) routes the challenge path correctly. HTTPS-only redirection or a different service on port 80 can prevent issuance even when port 443 is configured perfectly.
Reload after renewal
Certificate files in the Let’s Encrypt live directory change when a renewal occurs, but the running daemon must reload or restart according to your deployment process before it uses the new material. After every renewal, verify the certificate currently presented on port 443 rather than assuming the file change was picked up automatically.
Validate the configuration before and after reload
- Confirm the module: check the active configuration and verify that
mod_opensslis loaded. - Check syntax: run Lighttpd’s configuration test for the file used by your service, for example
lighttpd -tt -f /etc/lighttpd/lighttpd.conf. Correct any parse error before touching the running daemon. - Check the socket: verify that the
:443block containsssl.engine = "enable"and a readable defaultssl.pemfile. - Check each conditional: compare every
$HTTP["host"]spelling and path with the hostname-to-certificate map. - Check the chain and key: inspect each PEM and confirm that the private key matches its leaf certificate.
- Reload safely: reload or restart Lighttpd using the service manager for your operating system, then check the service status and logs.
- Test each SNI name: connect separately with each hostname and inspect the presented certificate and chain.
- Test the fallback: request an unknown hostname and use an SNI-less client test to confirm that the intended default certificate appears.
- Test issuance routing: if using Certbot HTTP-01, request the challenge path over port 80 and confirm it reaches the expected webroot or handler.
Testing with OpenSSL
OpenSSL can send a chosen SNI name and display the certificate returned by Lighttpd:
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsopenssl s_client -connect 203.0.113.10:443 -servername www.example.org -showcerts
Replace the example address with the server’s real IP. Run the command once for every hostname, changing -servername each time. Check the subject/SAN names, expiration, issuer chain, and whether the returned certificate is the one assigned to that conditional.
Testing with curl
When DNS is not ready or you need to force a particular address, curl can map a hostname to an IP while retaining the hostname used for TLS and HTTP:
Best Value
- Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
- Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
- Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
- Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
- Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.
curl --resolve www.example.org:443:203.0.113.10 https://www.example.org/ -v
The verbose output shows the TLS handshake and helps distinguish a certificate-selection problem from an application or virtual-host problem.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshoot the common failure modes
The wrong certificate appears for a known hostname
- Confirm the client is sending SNI; an old client or a deliberately SNI-less test receives the default.
- Check the hostname in the
$HTTP["host"]conditional character for character, includingwww. - Verify that the request reaches the intended Lighttpd instance and IP address rather than a load balancer or another server.
- Reload the daemon after changing certificate files or configuration.
Lighttpd will not start or reload
- Run the configuration test and fix syntax errors first.
- Check that every referenced path exists and is readable by the Lighttpd process.
- Check that the private key matches the certificate and that the PEM is not truncated.
- Confirm the installed version supports the directives used, especially
ssl.privkey.
Browsers report an incomplete chain
Replace a leaf-only file with the correctly ordered full chain in ssl.pemfile. The server certificate must come first, followed by the required intermediate certificates. Test the live endpoint after reloading; inspecting a local file alone does not prove Lighttpd is serving it.
Recommended Free Tools
Let’s Encrypt validation fails
- Verify DNS for the hostname resolves to this server.
- Open port 80 and ensure the HTTP-01 challenge is not blocked by a firewall, redirect loop, or unrelated virtual host.
- Confirm the challenge request is routed to the location Certbot expects.
- After successful renewal, reload Lighttpd and retest the live certificate.
Unknown names receive an unexpected certificate
This is expected behavior when no host conditional matches: Lighttpd uses the socket’s default certificate. Change the default if that fallback is inappropriate, or add a conditional for the legitimate hostname. An unmatched request cannot select a certificate that has not been configured.
SNI compared with separate IP addresses
| Consideration | SNI on one IP | Separate IP per domain |
|---|---|---|
| Client compatibility | Requires the client to send a hostname in the TLS handshake; SNI-less clients receive the default certificate. | Works with clients that do not send SNI because each certificate is bound to its own address and socket. |
| Address use | Several hostnames share one IP and port 443, conserving IPv4 addresses. | Consumes an additional address for each independently bound domain. |
| Certificate selection | Uses the socket default plus $HTTP["host"] overrides. |
Binds a certificate directly to each separate $SERVER["socket"] block. |
| Failure behavior | An omitted or unmatched SNI name receives the deliberate default certificate. | The client reaches the certificate assigned to the destination address. |
| Operational trade-off | Scales efficiently but requires careful hostname conditionals and fallback testing. | Can support legacy clients but increases address allocation and socket management. |
For modern public HTTPS sites, SNI is usually the practical choice because it avoids assigning one IPv4 address to every certificate. Separate addresses remain useful when compatibility with non-SNI clients is a hard requirement or when an installation needs strict address-level separation.
Operational checklist
- Keep one deliberate default certificate in the
:443socket. - Use one host conditional per additional hostname and keep names consistent with DNS and certificates.
- Use a full chain in every
ssl.pemfilewhere intermediates are required. - Protect private keys and verify Lighttpd can read them.
- Check the Lighttpd version before relying on
ssl.privkeyor newer certificate-refresh behavior. - Run a syntax check before every reload.
- Test every hostname with SNI, then test an unknown name and an SNI-less connection.
- If using Certbot HTTP-01, preserve working port-80 challenge routing.
- Reload or restart after renewal and inspect the certificate served by the running daemon.
What happens when a client does not send SNI?
The client cannot identify a hostname during the TLS handshake, so Lighttpd has no name to use for a conditional certificate. It returns the certificate configured directly on the :443 socket. This is why the default certificate is not optional and why it should be selected with the fallback case in mind.
Can one certificate cover several hostnames?
Yes, a single certificate can list multiple names in its SAN extension, and a wildcard can cover names within its permitted scope. That does not remove the need to configure the names users actually request: Lighttpd still needs the appropriate host routing, and every name must be included in the certificate’s validated name set. Use separate conditionals when different hostnames have independently issued certificates.
The Bottom Line
Enable mod_openssl, configure a valid default certificate on the shared :443 socket, and override the certificate and key in a $HTTP["host"] block for each hostname. Validate SNI selection, chain order, fallback behavior, and renewal reloads before putting the configuration into production.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




