I've setup a SSL certificate on lighttpd, on Ubuntu 10.

The issue is that when I try to access to https://mydomain.com I get "impossible to connect". If I use http://mydomain.com, it works perfectly.

This is my configuration file:

$HTTP["host"] == "XXX.XXX.95.175:443" {

  ssl.engine = "enable"
  ssl.ca-file = "/var/ssl/gd_bundle.crt"
  ssl.pemfile = "/var/ssl/mydomain.com.pem"


$HTTP["host"] =~ "(^|\.)mydomain\.com$" {
  server.document-root = "/var/www/path/to/website"

I have double checked I've done all necessary steps.

My domain correctly points to the ip XXX.XXX.95.175 (i've checked by pinging it).

Lighttpd is compiled with ssl: lighttpd-1.4.6 (ssl) - a light and fast webserver What's wrong ? thanks

  • if you're hosting on linux can you do a "netstat -an | grep 443"? You should see a tcp port 443 open. on windows just do a netstat -an. – Marm0t Nov 11 '10 at 21:12
  • @Marm0t Indeed no results. I need to open port 443 I guess.. how – aneuryzm Nov 11 '10 at 21:15

You need a $SERVER["socket"] rather than $HTTP["host"]

$SERVER["socket"] does double duty for telling lighttpd what sockets to listen on as well as what to do when someone connects to it.

The SSL configuration guide here goes into more detail, including using $HTTP["scheme"] to tell whether the browser is using https or not (but you'll need to upgrade to at least 1.4.16... even Debian Lenny is at 1.4.19, you really need to upgrade)

| improve this answer | |
  • I dunno how is possible I've copied pasted lighttpd-1.4.6.. I've run few seconds ago and it is lighttpd-1.4.19 (ssl). So I guess it is updated. thanks – aneuryzm Nov 11 '10 at 21:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.