summaryrefslogtreecommitdiffhomepage
path: root/src/mail/ngx_mail_ssl_module.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-10-20Mail: connections with wrong ALPN protocols are now rejected.Vladimir Homutov1-0/+58
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/
2021-08-16SSL: ciphers now set before loading certificates (ticket #2035).Maxim Dounin1-7/+7
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.
2021-03-05SSL: fixed build by Sun C with old OpenSSL versions.Maxim Dounin1-2/+2
Sun C complains about "statement not reached" if a "return" is followed by additional statements.
2020-10-22SSL: ssl_conf_command directive.Maxim Dounin1-0/+32
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.
2019-09-16SSL: fixed ssl_verify_client error message.Sergey Kandaurov1-1/+1
2019-03-03SSL: fixed potential leak on memory allocation errors.Maxim Dounin1-0/+1
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.
2019-02-25SSL: adjusted session id context with dynamic certificates.Maxim Dounin1-1/+1
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.
2018-04-25SSL: deprecated the "ssl" directive.Ruslan Ermilov1-1/+6
2018-04-24SSL: detect "listen ... ssl" without certificates (ticket #178).Maxim Dounin1-49/+37
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.
2018-04-24Mail: fixed error message about missing ssl_certificate_key.Maxim Dounin1-2/+2
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".
2017-04-18SSL: added support for TLSv1.3 in ssl_protocols directive.Sergey Kandaurov1-0/+1
Support for the TLSv1.3 protocol will be introduced in OpenSSL 1.1.1.
2016-09-20Fixed log levels of configuration parsing errors.Valentin Bartenev1-2/+2
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".
2016-06-15SSL: ngx_ssl_ciphers() to set list of ciphers.Tim Taubert1-14/+3
This patch moves various OpenSSL-specific function calls into the OpenSSL module and introduces ngx_ssl_ciphers() to make nginx more crypto-library-agnostic.
2016-05-19SSL: support for multiple curves (ticket #885).Maxim Dounin1-1/+1
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.
2016-05-19SSL: support for multiple certificates (ticket #814).Maxim Dounin1-15/+30
2016-03-31SSL: RSA_generate_key() is deprecated in OpenSSL 1.1.0.Maxim Dounin1-1/+1
OpenSSL removed support for all 40 and 56 bit ciphers.
2016-03-30Style.Ruslan Ermilov1-3/+3
2015-05-25Disabled SSLv3 by default (ticket #653).Maxim Dounin1-1/+1
2015-03-23SSL: avoid SSL_CTX_set_tmp_rsa_callback() call with LibreSSL.Maxim Dounin1-0/+2
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.
2015-02-25Mail: client SSL certificates support.Maxim Dounin1-0/+87
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.
2014-06-16SSL: the "ssl_password_file" directive.Valentin Bartenev1-1/+36
2014-01-10SSL: ssl_session_tickets directive.Dirkjan Bussink1-0/+17
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.
2013-10-11SSL: added ability to set keys used for Session Tickets (RFC5077).Piotr Sikora1-0/+17
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>
2013-09-30Mail: fixed segfault with ssl/starttls at mail{} level and no cert.Maxim Dounin1-0/+5
A configuration like "mail { starttls on; server {}}" triggered NULL pointer dereference in ngx_mail_ssl_merge_conf() as conf->file was not set.
2013-09-22SSL: stop loading configs with invalid "ssl_ciphers" values.Piotr Sikora1-9/+8
While there, remove unnecessary check in ngx_mail_ssl_module. Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
2013-05-21Style: remove unnecessary references to HTTP from non-HTTP modules.Piotr Sikora1-2/+2
No functional changes. Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
2013-05-10Mail: missing ngx_ssl_ecdh_curve() call.F. da Silva1-0/+4
2012-01-18Copyright updated.Maxim Konovalov1-0/+1
2012-01-11Added support for TLSv1.1, TLSv1.2 in ssl_protocols directive.Maxim Dounin1-1/+4
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.
2011-09-27Fix for "ssl_session_cache builtin" (broken since 1.1.1, r3993).Maxim Dounin1-2/+2
2011-08-04A new fix for the case when ssl_session_cache defined, but ssl is notIgor Sysoev1-0/+2
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.
2011-07-20ECDHE supportIgor Sysoev1-1/+13
patch by Adrian Kotelba
2011-07-20MSIE export versions are rare now, so RSA 512 key is generated on demandIgor Sysoev1-3/+1
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.
2011-06-27use !aNULL to disable all anonymous cipher suitesIgor Sysoev1-1/+1
patch by Rob Stradling
2010-05-14ngx_str_set() and ngx_str_null()Igor Sysoev1-2/+1
2009-10-07use only strong ciphers by defaultIgor Sysoev1-1/+1
2009-10-06disable SSLv2 and low ciphers by defaultIgor Sysoev1-3/+2
2009-07-23delete OpenSSL pre-0.9.7 compatibility: the sources were not actuallyIgor Sysoev1-32/+0
compatible with OpenSSL 0.9.6 since ssl_session_cache introduction
2009-06-02return NULL instead of NGX_CONF_ERROR on a create conf failureIgor Sysoev1-1/+1
2009-04-27fix building by MSVC8Igor Sysoev1-1/+1
2008-09-01*) listen sslIgor Sysoev1-14/+107
*) no default ssl_cetificate and ssl_cetificate_key
2008-07-29fix typoIgor Sysoev1-6/+6
2008-06-16DH parameters, ssl_dhparamIgor Sysoev1-4/+16
2008-05-26ssl_session_cache noneIgor Sysoev1-1/+6
2007-12-26ssl_session_cache offIgor Sysoev1-4/+8
2007-09-15ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_moduleIgor Sysoev1-0/+2
2007-03-19Many changes:Igor Sysoev1-0/+393
*) rename imap to mail, sort pop3/imap functions *) smtp auth support *) pop3 starttls only *) fix segfault if cram-md5 was used without apop