SSL certificate doesn’t work. Cannot connect to https://thedomain.com

lighttpdssl

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

Best Answer

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)