10-ssl.conf.erb 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # Generated by Chef
  2. ##
  3. ## SSL settings
  4. ##
  5. # SSL/TLS support: yes, no, required. <doc/wiki/SSL.txt>
  6. <%= Dovecot::Conf.attribute(@conf, 'ssl', 'yes') %>
  7. # PEM encoded X.509 SSL/TLS certificate and private key. They're opened before
  8. # dropping root privileges, so keep the key file unreadable by anyone but
  9. # root. Included doc/mkcert.sh can be used to easily generate self-signed
  10. # certificate, just make sure to update the domains in dovecot-openssl.cnf
  11. <% case node['platform']
  12. when 'redhat','centos','scientific','fedora','suse','amazon' then
  13. ssl_cert = '</etc/pki/dovecot/certs/dovecot.pem'
  14. ssl_key = '</etc/pki/dovecot/certs/dovecot.pem'
  15. ca_pem = '</etc/pki/dovecot/certs/ca.pem'
  16. # when 'debian', 'ubuntu' then
  17. else
  18. ssl_cert = '</etc/ssl/certs/dovecot.pem'
  19. ssl_key = '</etc/ssl/private/dovecot.pem'
  20. ca_pem = '</etc/ssl/certs/ca.pem'
  21. end
  22. -%>
  23. <%= Dovecot::Conf.attribute(@conf, 'ssl_cert', ssl_cert) %>
  24. <%= Dovecot::Conf.attribute(@conf, 'ssl_key', ssl_key) %>
  25. # If key file is password protected, give the password here. Alternatively
  26. # give it when starting dovecot with -p parameter. Since this file is often
  27. # world-readable, you may want to place this setting instead to a different
  28. # root owned 0600 file by using ssl_key_password = <path.
  29. <%= Dovecot::Conf.attribute(@conf, 'ssl_key_password') %>
  30. # PEM encoded trusted certificate authority. Set this only if you intend to use
  31. # ssl_verify_client_cert=yes. The file should contain the CA certificate(s)
  32. # followed by the matching CRL(s). (e.g. ssl_ca = <%= ca_pem %>)
  33. <%= Dovecot::Conf.attribute(@conf, 'ssl_ca') %>
  34. # Request client to send a certificate. If you also want to require it, set
  35. # auth_ssl_require_client_cert=yes in auth section.
  36. <%= Dovecot::Conf.attribute(@conf, 'ssl_verify_client_cert', false) %>
  37. # Which field from certificate to use for username. commonName and
  38. # x500UniqueIdentifier are the usual choices. You'll also need to set
  39. # auth_ssl_username_from_cert=yes.
  40. <%= Dovecot::Conf.attribute(@conf, 'ssl_cert_username_field', 'commonName') %>
  41. # How often to regenerate the SSL parameters file. Generation is quite CPU
  42. # intensive operation. The value is in hours, 0 disables regeneration
  43. # entirely.
  44. <%= Dovecot::Conf.attribute(@conf, 'ssl_parameters_regenerate', 168) %>
  45. # SSL ciphers to use
  46. <%= Dovecot::Conf.attribute(@conf, 'ssl_cipher_list', 'ALL:!LOW:!SSLv2:!EXP:!aNULL') %>