aboutsummaryrefslogtreecommitdiff
path: root/src/mail/ngx_mail_ssl_module.c
Commit message (Collapse)AuthorAge
* SSL: a new macro to set default protocol versions.Sergey Kandaurov2024-11-22
| | | | | | | | | This simplifies merging protocol values after ea15896 and ebd18ec. Further, as outlined in ebd18ec18, for libraries preceeding TLSv1.2+ support, only meaningful versions TLSv1 and TLSv1.1 are set by default. While here, fixed indentation.
* SSL: fixed MSVC compilation after ebd18ec1812b.蕭澧邦2024-11-11
| | | | | MSVC generates a compilation error in case #if/#endif is used in a macro parameter.
* SSL: disabled TLSv1 and TLSv1.1 by default.Sergey Kandaurov2024-10-31
| | | | | | | | | | | | | | | TLSv1 and TLSv1.1 are formally deprecated and forbidden to negotiate due to insufficient security reasons outlined in RFC 8996. TLSv1 and TLSv1.1 are disabled in BoringSSL e95b0cad9 and LibreSSL 3.8.1 in the way they cannot be enabled in nginx configuration. In OpenSSL 3.0, they are only permitted at security level 0 (disabled by default). The support is dropped in Chrome 84, Firefox 78, and deprecated in Safari. This change disables TLSv1 and TLSv1.1 by default for OpenSSL 1.0.1 and newer, where TLSv1.2 support is available. For older library versions, which do not have alternatives, these protocol versions remain enabled.
* SSL: optional ssl_client_certificate for ssl_verify_client.Sergey Kandaurov2024-09-20
| | | | | | | | | | | | | | | | | | | | | | | | | Starting from TLSv1.1 (as seen since draft-ietf-tls-rfc2246-bis-00), the "certificate_authorities" field grammar of the CertificateRequest message was redone to allow no distinguished names. In TLSv1.3, with the restructured CertificateRequest message, this can be similarly done by optionally including the "certificate_authorities" extension. This allows to avoid sending DNs at all. In practice, aside from published TLS specifications, all supported SSL/TLS libraries allow to request client certificates with an empty DN list for any protocol version. For instance, when operating in TLSv1, this results in sending the "certificate_authorities" list as a zero-length vector, which corresponds to the TLSv1.1 specification. Such behaviour goes back to SSLeay. The change relaxes the requirement to specify at least one trusted CA certificate in the ssl_client_certificate directive, which resulted in sending DNs of these certificates (closes #142). Instead, all trusted CA certificates can be specified now using the ssl_trusted_certificate directive if needed. A notable difference that certificates specified in ssl_trusted_certificate are always loaded remains (see 3648ba7db). Co-authored-by: Praveen Chaudhary <praveenc@nvidia.com>
* SSL: removed the "ssl" directive.Roman Arutyunyan2023-06-08
| | | | | | It has been deprecated since 7270:46c0c7ef4913 (1.15.0) in favour of the "ssl" parameter of the "listen" directive, which has been available since 2224:109849282793 (0.7.14).
* SSL: enabled TLSv1.3 by default.Maxim Dounin2023-03-24
|
* SSL: improved validation of ssl_session_cache and ssl_ocsp_cache.Sergey Kandaurov2022-10-17
| | | | | | | Now it properly detects invalid shared zone configuration with omitted size. Previously it used to read outside of the buffer boundary. Found with AddressSanitizer.
* Mail: connections with wrong ALPN protocols are now rejected.Vladimir Homutov2021-10-20
| | | | | | | | | | | This is a recommended behavior by RFC 7301 and is useful for mitigation of protocol confusion attacks [1]. For POP3 and IMAP protocols IANA-assigned ALPN IDs are used [2]. For the SMTP protocol "smtp" is used. [1] https://alpaca-attack.com/ [2] https://www.iana.org/assignments/tls-extensiontype-values/
* SSL: ciphers now set before loading certificates (ticket #2035).Maxim Dounin2021-08-16
| | | | | | | To load old/weak server or client certificates it might be needed to adjust the security level, as introduced in OpenSSL 1.1.0. This change ensures that ciphers are set before loading the certificates, so security level changes via the cipher string apply to certificate loading.
* SSL: fixed build by Sun C with old OpenSSL versions.Maxim Dounin2021-03-05
| | | | | Sun C complains about "statement not reached" if a "return" is followed by additional statements.
* SSL: ssl_conf_command directive.Maxim Dounin2020-10-22
| | | | | | | | | | | | | | | | | | | | | | | | | With the ssl_conf_command directive it is now possible to set arbitrary OpenSSL configuration parameters as long as nginx is compiled with OpenSSL 1.0.2 or later. Full list of available configuration commands can be found in the SSL_CONF_cmd manual page (https://www.openssl.org/docs/man1.1.1/man3/SSL_CONF_cmd.html). In particular, this allows configuring PrioritizeChaCha option (ticket #1445): ssl_conf_command Options PrioritizeChaCha; It can be also used to configure TLSv1.3 ciphers in OpenSSL, which fails to configure them via the SSL_CTX_set_cipher_list() interface (ticket #1529): ssl_conf_command Ciphersuites TLS_CHACHA20_POLY1305_SHA256; Configuration commands are applied after nginx own configuration for SSL, so they can be used to override anything set by nginx. Note though that configuring OpenSSL directly with ssl_conf_command might result in a behaviour nginx does not expect, and should be done with care.
* SSL: fixed ssl_verify_client error message.Sergey Kandaurov2019-09-16
|
* SSL: fixed potential leak on memory allocation errors.Maxim Dounin2019-03-03
| | | | | | | | | If ngx_pool_cleanup_add() fails, we have to clean just created SSL context manually, thus appropriate call added. Additionally, ngx_pool_cleanup_add() moved closer to ngx_ssl_create() in the ngx_http_ssl_module, to make sure there are no leaks due to intermediate code.
* SSL: adjusted session id context with dynamic certificates.Maxim Dounin2019-02-25
| | | | | | | | | | | | Dynamic certificates re-introduce problem with incorrect session reuse (AKA "virtual host confusion", CVE-2014-3616), since there are no server certificates to generate session id context from. To prevent this, session id context is now generated from ssl_certificate directives as specified in the configuration. This approach prevents incorrect session reuse in most cases, while still allowing sharing sessions across multiple machines with ssl_session_ticket_key set as long as configurations are identical.
* SSL: deprecated the "ssl" directive.Ruslan Ermilov2018-04-25
|
* SSL: detect "listen ... ssl" without certificates (ticket #178).Maxim Dounin2018-04-24
| | | | | | | | | In mail and stream modules, no certificate provided is a fatal condition, much like with the "ssl" and "starttls" directives. In http, "listen ... ssl" can be used in a non-default server without certificates as long as there is a certificate in the default one, so missing certificate is only fatal for default servers.
* Mail: fixed error message about missing ssl_certificate_key.Maxim Dounin2018-04-24
| | | | | | | In 51e1f047d15d, the "ssl" directive name was incorrectly hardcoded in the error message shown when there are some SSL keys defined, but not for all certificates. Right approach is to use the "mode" variable, which can be either "ssl" or "starttls".
* SSL: added support for TLSv1.3 in ssl_protocols directive.Sergey Kandaurov2017-04-18
| | | | Support for the TLSv1.3 protocol will be introduced in OpenSSL 1.1.1.
* Fixed log levels of configuration parsing errors.Valentin Bartenev2016-09-20
| | | | | | All the errors that prevent loading configuration must be printed on the "emerg" log level. Previously, nginx might silently fail to load configuration in some cases as the default log level is "error".
* SSL: ngx_ssl_ciphers() to set list of ciphers.Tim Taubert2016-06-15
| | | | | | This patch moves various OpenSSL-specific function calls into the OpenSSL module and introduces ngx_ssl_ciphers() to make nginx more crypto-library-agnostic.
* SSL: support for multiple curves (ticket #885).Maxim Dounin2016-05-19
| | | | | | | | | | | | | | | | | | OpenSSL 1.0.2+ allows configuring a curve list instead of a single curve previously supported. This allows use of different curves depending on what client supports (as available via the elliptic_curves extension), and also allows use of different curves in an ECDHE key exchange and in the ECDSA certificate. The special value "auto" was introduced (now the default for ssl_ecdh_curve), which means "use an internal list of curves as available in the OpenSSL library used". For versions prior to OpenSSL 1.0.2 it maps to "prime256v1" as previously used. The default in 1.0.2b+ prefers prime256v1 as well (and X25519 in OpenSSL 1.1.0+). As client vs. server preference of curves is controlled by the same option as used for ciphers (SSL_OP_CIPHER_SERVER_PREFERENCE), the ssl_prefer_server_ciphers directive now controls both.
* SSL: support for multiple certificates (ticket #814).Maxim Dounin2016-05-19
|
* SSL: RSA_generate_key() is deprecated in OpenSSL 1.1.0.Maxim Dounin2016-03-31
| | | | OpenSSL removed support for all 40 and 56 bit ciphers.
* Style.Ruslan Ermilov2016-03-30
|
* Disabled SSLv3 by default (ticket #653).Maxim Dounin2015-05-25
|
* SSL: avoid SSL_CTX_set_tmp_rsa_callback() call with LibreSSL.Maxim Dounin2015-03-23
| | | | | | | | LibreSSL removed support for export ciphers and a call to SSL_CTX_set_tmp_rsa_callback() results in an error left in the error queue. This caused alerts "ignoring stale global SSL error (...called a function you should not call) while SSL handshaking" on a first connection in each worker process.
* Mail: client SSL certificates support.Maxim Dounin2015-02-25
| | | | | | | | | | | | | | | | | | The "ssl_verify_client", "ssl_verify_depth", "ssl_client_certificate", "ssl_trusted_certificate", and "ssl_crl" directives introduced to control SSL client certificate verification in mail proxy module. If there is a certificate, detail of the certificate are passed to the auth_http script configured via Auth-SSL-Verify, Auth-SSL-Subject, Auth-SSL-Issuer, Auth-SSL-Serial, Auth-SSL-Fingerprint headers. If the auth_http_pass_client_cert directive is set, client certificate in PEM format will be passed in the Auth-SSL-Cert header (urlencoded). If there is no required certificate provided during an SSL handshake or certificate verification fails then a protocol-specific error is returned after the SSL handshake and the connection is closed. Based on previous work by Sven Peter, Franck Levionnois and Filipe Da Silva.
* SSL: the "ssl_password_file" directive.Valentin Bartenev2014-06-16
|
* SSL: ssl_session_tickets directive.Dirkjan Bussink2014-01-10
| | | | | | | | | | | | | | This adds support so it's possible to explicitly disable SSL Session Tickets. In order to have good Forward Secrecy support either the session ticket key has to be reloaded by using nginx' binary upgrade process or using an external key file and reloading the configuration. This directive adds another possibility to have good support by disabling session tickets altogether. If session tickets are enabled and the process lives for a long a time, an attacker can grab the session ticket from the process and use that to decrypt any traffic that occured during the entire lifetime of the process.
* SSL: added ability to set keys used for Session Tickets (RFC5077).Piotr Sikora2013-10-11
| | | | | | | | | | | | | | | | In order to support key rollover, ssl_session_ticket_key can be defined multiple times. The first key will be used to issue and resume Session Tickets, while the rest will be used only to resume them. ssl_session_ticket_key session_tickets/current.key; ssl_session_ticket_key session_tickets/prev-1h.key; ssl_session_ticket_key session_tickets/prev-2h.key; Please note that nginx supports Session Tickets even without explicit configuration of the keys and this feature should be only used in setups where SSL traffic is distributed across multiple nginx servers. Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
* Mail: fixed segfault with ssl/starttls at mail{} level and no cert.Maxim Dounin2013-09-30
| | | | | A configuration like "mail { starttls on; server {}}" triggered NULL pointer dereference in ngx_mail_ssl_merge_conf() as conf->file was not set.
* SSL: stop loading configs with invalid "ssl_ciphers" values.Piotr Sikora2013-09-22
| | | | | | While there, remove unnecessary check in ngx_mail_ssl_module. Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
* Style: remove unnecessary references to HTTP from non-HTTP modules.Piotr Sikora2013-05-21
| | | | | | No functional changes. Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
* Mail: missing ngx_ssl_ecdh_curve() call.F. da Silva2013-05-10
|
* Copyright updated.Maxim Konovalov2012-01-18
|
* Added support for TLSv1.1, TLSv1.2 in ssl_protocols directive.Maxim Dounin2012-01-11
| | | | | | Support for TLSv1.1 and TLSv1.2 protocols was introduced in OpenSSL 1.0.1 (-beta1 was recently released). This change makes it possible to disable these protocols and/or enable them without other protocols.
* Fix for "ssl_session_cache builtin" (broken since 1.1.1, r3993).Maxim Dounin2011-09-27
|
* A new fix for the case when ssl_session_cache defined, but ssl is notIgor Sysoev2011-08-04
| | | | | | | | enabled in any server. The previous r1033 does not help when unused zone becomes used after reconfiguration, so it is backed out. The initial thought was to make SSL modules independed from SSL implementation and to keep OpenSSL code dependance as much as in separate files.
* ECDHE supportIgor Sysoev2011-07-20
| | | | patch by Adrian Kotelba
* MSIE export versions are rare now, so RSA 512 key is generated on demandIgor Sysoev2011-07-20
| | | | | | and is shared among all hosts instead of pregenerating for every HTTPS host on configuraiton phase. This decreases start time for configuration with large number of HTTPS hosts.
* use !aNULL to disable all anonymous cipher suitesIgor Sysoev2011-06-27
| | | | patch by Rob Stradling
* ngx_str_set() and ngx_str_null()Igor Sysoev2010-05-14
|
* use only strong ciphers by defaultIgor Sysoev2009-10-07
|
* disable SSLv2 and low ciphers by defaultIgor Sysoev2009-10-06
|
* delete OpenSSL pre-0.9.7 compatibility: the sources were not actuallyIgor Sysoev2009-07-23
| | | | compatible with OpenSSL 0.9.6 since ssl_session_cache introduction
* return NULL instead of NGX_CONF_ERROR on a create conf failureIgor Sysoev2009-06-02
|
* fix building by MSVC8Igor Sysoev2009-04-27
|
* *) listen sslIgor Sysoev2008-09-01
| | | | *) no default ssl_cetificate and ssl_cetificate_key
* fix typoIgor Sysoev2008-07-29
|
* DH parameters, ssl_dhparamIgor Sysoev2008-06-16
|