ssl.txt 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. ===========
  2. Secure HTTP
  3. ===========
  4. ------------
  5. Module: core
  6. ------------
  7. :Author: Jan Kneschke
  8. :Date: $Date: 2004/08/29 09:44:53 $
  9. :Revision: $Revision: 1.2 $
  10. :abstract:
  11. How to set up SSL in lighttpd
  12. .. meta::
  13. :keywords: lighttpd, ssl
  14. .. contents:: Table of Contents
  15. Description
  16. ===========
  17. lighttpd supports TLS with mod_openssl.
  18. The latest lighttpd SSL/TLS doc can be found at:
  19. https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_SSL
  20. Configuration
  21. -------------
  22. To enable SSL for the whole server you have to provide a valid
  23. certificate and have to enable the SSL engine.::
  24. ssl.engine = "enable"
  25. ssl.pemfile = "/path/to/server.pem"
  26. To enable SSL for a specific port, put the directives within a
  27. $SERVER["socket"] condition: ::
  28. $SERVER["socket"] == "*:443" {
  29. ssl.engine = "enable"
  30. ssl.pemfile = "www.example.org.pem"
  31. server.name = "www.example.org"
  32. server.document-root = "/www/servers/www.example.org/pages/"
  33. }
  34. If you have a .crt and a .key file, cat them together into a
  35. single PEM file: ::
  36. $ cat host.key host.crt > host.pem
  37. or provide both ssl.pemfile and ssl.privkey directives: ::
  38. ssl.pemfile = "host.crt"
  39. ssl.privkey = "host.key"
  40. Self-Signed Certificates
  41. ------------------------
  42. A self-signed SSL certificate can be generated like this: ::
  43. $ openssl req -new -x509 \
  44. -keyout server.pem -out server.pem \
  45. -days 365 -nodes