From 93d405d58eca59bf15204b959239f211b7634b7b Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 17 Dec 2024 16:16:59 +0200 Subject: [PATCH 1/3] settings: Add ssl_client and ssl_server named filters --- data/settings.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/data/settings.js b/data/settings.js index a6b97a596..72b920b7b 100644 --- a/data/settings.js +++ b/data/settings.js @@ -10121,6 +10121,13 @@ This setting is used for both incoming and outgoing SSL connections. See: https://wiki.openssl.org/index.php/TLS1.3#Ciphersuites` }, + ssl_client: { + seealso: [ 'ssl', 'ssl_server', '[[link,ssl_configuration]]' ], + values: setting_types.NAMED_FILTER, + text: ` +Named filter, which can be used for specifying SSL client settings.` + }, + ssl_client_ca_dir: { seealso: [ 'ssl', '[[link,ssl_configuration]]' ], values: setting_types.STRING, @@ -10375,6 +10382,13 @@ Note: This setting doesn't yet require the certificate to be valid or to even exist. See [[setting,auth_ssl_require_client_cert]].` }, + ssl_server: { + seealso: [ 'ssl', 'ssl_client', '[[link,ssl_configuration]]' ], + values: setting_types.NAMED_FILTER, + text: ` +Named filter, which can be used for specifying SSL server settings.` + }, + state_dir: { default: '/var/lib/dovecot', values: setting_types.STRING, From 0887b5ddaa95b7f309bbf7282610f5135ca70f36 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 17 Dec 2024 16:17:33 +0200 Subject: [PATCH 2/3] settings: Change ssl_cipher_list default for ssl_client --- data/settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/settings.js b/data/settings.js index 72b920b7b..c62570a8a 100644 --- a/data/settings.js +++ b/data/settings.js @@ -10095,7 +10095,7 @@ Note: [[setting,auth_ssl_username_from_cert]] MUST be enabled.` }, ssl_cipher_list: { - default: 'ALL:!kRSA:!SRP:!kDHd:!DSS:!aNULL:!eNULL:!EXPORT:!DES:!3DES:!MD5:!PSK:!RC4:!ADH:!LOW@STRENGTH', + default: 'ALL:!kRSA:!SRP:!kDHd:!DSS:!aNULL:!eNULL:!EXPORT:!DES:!3DES:!MD5:!PSK:!RC4:!ADH:!LOW@STRENGTH (for ssl_server, empty for ssl_client)', seealso: [ 'ssl', 'ssl_cipher_suites', 'ssl_min_protocol', '[[link,ssl_configuration]]' ], values: setting_types.STRING, text: ` From 2c7338b9c10260cb876a7d1b873fd1cc6e13b70b Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 19 Dec 2024 15:10:53 +0200 Subject: [PATCH 3/3] global: Add ssl_server_ prefix to ssl server settings --- data/settings.js | 87 +++++++++---------- docs/core/config/guides/quick.md | 8 +- docs/core/config/service.md | 2 +- docs/core/config/ssl.md | 78 ++++++++--------- docs/core/man/doveconf.1.md | 2 +- docs/core/man/dovecot.1.md | 2 +- docs/howto/imapc_proxy.md | 8 +- docs/howto/virtual/postfix.md | 4 +- .../include/2.4-removed-other-features.inc | 2 +- 9 files changed, 96 insertions(+), 97 deletions(-) diff --git a/data/settings.js b/data/settings.js index c62570a8a..63389c093 100644 --- a/data/settings.js +++ b/data/settings.js @@ -4409,8 +4409,8 @@ It is usually neither necessary nor advisable to change the default.` auth_ssl_require_client_cert: { default: 'no', seealso: [ - 'ssl_ca_file', - 'ssl_request_client_cert', + 'ssl_server_ca_file', + 'ssl_server_request_client_cert', '[[link,ssl_configuration]]', ], values: setting_types.BOOLEAN, @@ -4421,7 +4421,7 @@ provided.` auth_ssl_username_from_cert: { default: 'no', - seealso: [ 'ssl_cert_username_field' ], + seealso: [ 'ssl_server_cert_username_field' ], values: setting_types.BOOLEAN, text: ` Setting to \`yes\` indicates that the username should be taken from the @@ -4432,7 +4432,7 @@ Generally, this will be either \`commonName\` or \`x500UniqueIdentifier\`. The text is looked up from subject DN's specified field using OpenSSL's X509_NAME_get_text_by_NID() function. By default the CommonName field is used. You can change the field with -[[setting,ssl_cert_username_field,name]] setting (parsed using OpenSSL's +[[setting,ssl_server_cert_username_field,name]] setting (parsed using OpenSSL's OBJ_txt2nid() function). \`x500UniqueIdentifier\` is a common choice.` @@ -10013,7 +10013,7 @@ This setting affects the \`secured\` state of connections. See [[link,secured_connections]].` }, - ssl_alt_cert_file: { + ssl_server_alt_cert_file: { seealso: [ 'ssl', '[[link,ssl_configuration]]' ], values: setting_types.FILE, text: ` @@ -10025,29 +10025,29 @@ This is useful when migrating to e.g. an ECDSA certificate. Example: \`\`\`[dovecot.conf] -ssl_alt_cert_file = /path/to/alternative/cert.pem +ssl_server_alt_cert_file = /path/to/alternative/cert.pem \`\`\`` }, - ssl_alt_key_file: { - seealso: [ 'ssl', 'ssl_alt_cert_file', '[[link,ssl_configuration]]' ], + ssl_server_alt_key_file: { + seealso: [ 'ssl', 'ssl_server_alt_cert_file', '[[link,ssl_configuration]]' ], values: setting_types.FILE, text: ` -Private key for [[setting,ssl_alt_cert_file]]. +Private key for [[setting,ssl_server_alt_cert_file]]. Example: \`\`\`[dovecot.conf] -ssl_alt_key_file = /path/to/alternative/key.pem -ssl_alt_cert_file = /path/to/alternative/cert.pem +ssl_server_alt_key_file = /path/to/alternative/key.pem +ssl_server_alt_cert_file = /path/to/alternative/cert.pem \`\`\`` }, - ssl_ca_file: { + ssl_server_ca_file: { seealso: [ 'ssl', 'ssl_client_require_valid_cert', - 'ssl_request_client_cert', + 'ssl_server_request_client_cert', ], values: setting_types.FILE, text: ` @@ -10058,30 +10058,30 @@ valid. Example: \`\`\`[dovecot.conf] -ssl_ca_file = /etc/dovecot/ca.crt -ssl_request_client_cert = yes +ssl_server_ca_file = /etc/dovecot/ca.crt +ssl_server_request_client_cert = yes auth_ssl_require_client_cert = yes \`\`\`` }, - ssl_cert_file: { - seealso: [ 'ssl', 'ssl_key_file', '[[link,ssl_configuration]]' ], + ssl_server_cert_file: { + seealso: [ 'ssl', 'ssl_server_key_file', '[[link,ssl_configuration]]' ], values: setting_types.FILE, text: ` Path to the PEM-encoded X.509 SSL/TLS certificate presented for incoming imap/pop3/etc. client connections. -The [[setting,ssl_key_file]] is also needed for the private certificate. +The [[setting,ssl_server_key_file]] is also needed for the private certificate. Example: \`\`\`[dovecot.conf] -ssl_cert_file = /etc/ssl/private/dovecot.crt -ssl_key_file = /etc/ssl/private/dovecot.key +ssl_server_cert_file = /etc/ssl/private/dovecot.crt +ssl_server_key_file = /etc/ssl/private/dovecot.key \`\`\`` }, - ssl_cert_username_field: { + ssl_server_cert_username_field: { default: 'commonName', seealso: [ 'ssl', '[[link,ssl_configuration]]' ], values: setting_types.STRING, @@ -10232,7 +10232,7 @@ ssl_curve_list = P-521:P-384:P-256 \`\`\`` }, - ssl_dh_file: { + ssl_server_dh_file: { seealso: [ 'ssl', '[[link,ssl_configuration]]' ], values: setting_types.FILE, text: ` @@ -10246,7 +10246,7 @@ You can generate a new parameters file by, for example, running Example: \`\`\`[dovecot.conf] -ssl_dh_file = /path/to/dh.pem +ssl_server_dh_file = /path/to/dh.pem \`\`\`` }, @@ -10258,35 +10258,35 @@ ssl_dh_file = /path/to/dh.pem Require a valid certificate when connecting to external SSL services?` }, - ssl_key_file: { + ssl_server_key_file: { seealso: [ 'ssl', - 'ssl_cert_file', - 'ssl_key_password', + 'ssl_server_cert_file', + 'ssl_server_key_password', '[[link,ssl_configuration]]', ], values: setting_types.FILE, text: ` Path to the PEM-encoded X.509 SSL/TLS private key for -[[setting,ssl_cert_file]]. +[[setting,ssl_server_cert_file]]. Example: \`\`\`[dovecot.conf] -ssl_cert_file = /etc/ssl/private/dovecot.crt -ssl_key_file = /etc/ssl/private/dovecot.key +ssl_server_cert_file = /etc/ssl/private/dovecot.crt +ssl_server_key_file = /etc/ssl/private/dovecot.key \`\`\`` }, - ssl_key_password: { - seealso: [ 'ssl', 'ssl_key_file', '[[link,ssl_configuration]]' ], + ssl_server_key_password: { + seealso: [ 'ssl', 'ssl_server_key_file', '[[link,ssl_configuration]]' ], values: setting_types.STRING, text: ` -The password to use if [[setting,ssl_key_file]] is password-protected. +The password to use if [[setting,ssl_server_key_file]] is password-protected. Since this file is often world-readable, you may wish to specify the path to a file containing the password, rather than the password itself, by -using the format \`ssl_key_password = class3-revoke.pem ``` With the above settings, if a client connects which doesn't present a -certificate signed by one of the CAs in the `ssl_ca` file, Dovecot won't +certificate signed by one of the CAs in the [setting,ssl_server_ca_file]], Dovecot won't let the user log in. This could present a problem if you're using Dovecot to provide SASL authentication for an MTA (such as Postfix) which is not capable of supplying client certificates for SASL authentication. @@ -434,7 +434,7 @@ setting [[setting,auth_ssl_username_from_cert,yes]]. * By default the `CommonName` field is used. -* You can change the field with [[setting,ssl_cert_username_field,name]] +* You can change the field with [[setting,ssl_server_cert_username_field,name]] setting (parsed using OpenSSL's `OBJ_txt2nid()` function). `x500UniqueIdentifier` is a common choice. diff --git a/docs/core/man/doveconf.1.md b/docs/core/man/doveconf.1.md index a9652e361..bc30f58b2 100644 --- a/docs/core/man/doveconf.1.md +++ b/docs/core/man/doveconf.1.md @@ -94,7 +94,7 @@ configuration in easy human readable output. **-x** : Expand configuration variables (e.g. `$ENV:foo`) and show file contents - (from e.g. `ssl_key_password = \