summaryrefslogtreecommitdiff
path: root/doc/outdated/ssl.txt
blob: f9ee953779a822f9b55374de934e45905487985d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
===========
Secure HTTP
===========

------------
Module: core
------------

:Author: Jan Kneschke
:Date: $Date: 2004/08/29 09:44:53 $
:Revision: $Revision: 1.2 $

:abstract:
  How to set up SSL in lighttpd

.. meta::
  :keywords: lighttpd, ssl

.. contents:: Table of Contents

Description
===========

lighttpd supports TLS with mod_openssl.

The latest lighttpd SSL/TLS doc can be found at:
https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_SSL

Configuration
-------------

To enable SSL for the whole server you have to provide a valid
certificate and have to enable the SSL engine.::

  ssl.engine = "enable"
  ssl.pemfile = "/path/to/server.pem"

To enable SSL for a specific port, put the directives within a
$SERVER["socket"] condition: ::

  $SERVER["socket"] == "*:443" {
    ssl.engine                  = "enable"
    ssl.pemfile                 = "www.example.org.pem"
    server.name                 = "www.example.org"

    server.document-root        = "/www/servers/www.example.org/pages/"
  }

If you have a .crt and a .key file, cat them together into a
single PEM file: ::

  $ cat host.key host.crt > host.pem

or provide both ssl.pemfile and ssl.privkey directives: ::

  ssl.pemfile = "host.crt"
  ssl.privkey = "host.key"

Self-Signed Certificates
------------------------

A self-signed SSL certificate can be generated like this: ::

  $ openssl req -new -x509 \
    -keyout server.pem -out server.pem \
    -days 365 -nodes