summaryrefslogtreecommitdiffhomepage
path: root/src/http/modules/ngx_http_ssl_module.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-02-25SSL: fixed possible segfault with dynamic certificates.Maxim Dounin1-1/+1
A virtual server may have no SSL context if it does not have certificates defined, so we have to use config of the ngx_http_ssl_module from the SSL context in the certificate callback. To do so, it is now passed as the argument of the callback. The stream module doesn't really need any changes, but was modified as well to match http 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.
2019-02-25SSL: passwords support for dynamic certificate loading.Maxim Dounin1-0/+5
Passwords have to be copied to the configuration pool to be used at runtime. Also, to prevent blocking on stdin (with "daemon off;") an empty password list is provided. To make things simpler, password handling was modified to allow an empty array (with 0 elements and elts set to NULL) as an equivalent of an array with 1 empty password.
2019-02-25SSL: variables support in ssl_certificate and ssl_certificate_key.Maxim Dounin1-4/+112
To evaluate variables, a request is created in the certificate callback, and then freed. To do this without side effects on the stub_status counters and connection state, an additional function was introduced, ngx_http_alloc_request(). Only works with OpenSSL 1.0.2+, since there is no SSL_CTX_set_cert_cb() in older versions.
2018-08-07SSL: support for TLSv1.3 early data with BoringSSL.Maxim Dounin1-0/+18
Early data AKA 0-RTT mode is enabled as long as "ssl_early_data on" is specified in the configuration (default is off). The $ssl_early_data variable evaluates to "1" if the SSL handshake isn't yet completed, and can be used to set the Early-Data header as per draft-ietf-httpbis-replay-04.
2018-04-25SSL: deprecated the "ssl" directive.Ruslan Ermilov1-1/+6
2018-04-24SSL: detect "listen ... ssl" without certificates (ticket #178).Maxim Dounin1-2/+31
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.
2017-08-22SSL: the $ssl_client_escaped_cert variable (ticket #857).Maxim Dounin1-0/+4
This variable contains URL-encoded client SSL certificate. In contrast to $ssl_client_cert, it doesn't depend on deprecated header continuation. The NGX_ESCAPE_URI_COMPONENT variant of encoding is used, so the resulting variable can be safely used not only in headers, but also as a request argument. The $ssl_client_cert variable should be considered deprecated now. The $ssl_client_raw_cert variable will be eventually renambed back to $ssl_client_cert.
2017-08-01Variables: macros for null variables.Ruslan Ermilov1-1/+1
No functional changes.
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-12-05SSL: $ssl_curves (ticket #1088).Maxim Dounin1-0/+3
The variable contains a list of curves as supported by the client. Known curves are listed by their names, unknown ones are shown in hex, e.g., "0x001d:prime256v1:secp521r1:secp384r1". Note that OpenSSL uses session data for SSL_get1_curves(), and it doesn't store full list of curves supported by the client when serializing a session. As a result $ssl_curves is only available for new sessions (and will be empty for reused ones). The variable is only meaningful when using OpenSSL 1.0.2 and above. With older versions the variable is empty.
2016-12-05SSL: $ssl_ciphers (ticket #870).Maxim Dounin1-0/+3
The variable contains list of ciphers as supported by the client. Known ciphers are listed by their names, unknown ones are shown in hex, e.g., ""AES128-SHA:AES256-SHA:0x00ff". The variable is fully supported only when using OpenSSL 1.0.2 and above. With older version there is an attempt to provide some information using SSL_get_shared_ciphers(). It only lists known ciphers though. Moreover, as OpenSSL uses session data for SSL_get_shared_ciphers(), and it doesn't store relevant data when serializing a session. As a result $ssl_ciphers is only available for new sessions (and not available for reused ones) when using OpenSSL older than 1.0.2.
2016-12-05SSL: $ssl_client_v_start, $ssl_client_v_end, $ssl_client_v_remain.Maxim Dounin1-0/+9
2016-10-21SSL: RFC2253 compliant $ssl_client_s_dn and $ssl_client_i_dn.Dmitry Volyntsev1-0/+6
Originally, the variables kept a result of X509_NAME_oneline(), which is, according to the official documentation, a legacy function. It produces a non standard output form and has various quirks and inconsistencies. The RFC2253 compliant behavior is introduced for these variables. The original variables are available through $ssl_client_s_dn_legacy and $ssl_client_i_dn_legacy.
2016-06-15SSL: ngx_ssl_ciphers() to set list of ciphers.Tim Taubert1-15/+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/+31
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-31Fixed logging with variable field width.Sergey Kandaurov1-2/+3
2016-03-30Style.Ruslan Ermilov1-2/+2
2015-09-11The HTTP/2 implementation (RFC 7240, 7241).Valentin Bartenev1-11/+13
The SPDY support is removed, as it's incompatible with the new module.
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.
2014-06-16SSL: the "ssl_password_file" directive.Valentin Bartenev1-1/+36
2014-05-20SSL: $ssl_client_fingerprint variable.Sergey Budnevitch1-0/+3
2014-04-18SSL: $ssl_server_name variable.Maxim Dounin1-0/+3
2014-02-11SSL: the $ssl_session_reused variable.Maxim Dounin1-0/+3
2014-01-28SSL: support ALPN (IETF's successor to NPN).Piotr Sikora1-2/+70
Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
2014-01-14SSL: fixed ssl_verify_depth to take only one argument.Maxim Dounin1-1/+1
2014-01-10SSL: ssl_session_tickets directive.Dirkjan Bussink1-0/+16
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-12-20SSL: ssl_buffer_size directive.Maxim Dounin1-0/+13
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-22SSL: stop loading configs with invalid "ssl_ciphers" values.Piotr Sikora1-0/+1
While there, remove unnecessary check in ngx_mail_ssl_module. Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
2013-03-20Preliminary experimental support for SPDY draft 2.Valentin Bartenev1-1/+16
2013-03-07SSL: Next Protocol Negotiation extension support.Valentin Bartenev1-0/+34
Not only this is useful for the upcoming SPDY support, but it can also help to improve HTTPS performance by enabling TLS False Start in Chrome/Chromium browsers [1]. So, we always enable NPN for HTTPS if it is supported by OpenSSL. [1] http://www.imperialviolet.org/2012/04/11/falsestart.html
2013-02-19Removed zero termination of shm zone names.Valentin Bartenev1-1/+0
It was added in r2717 and no longer needed since r2721, where the termination was added to ngx_shm_alloc() and ngx_init_zone_pool(). So then it only corrupts error messages about ivalid zones.
2012-10-05OCSP stapling: properly check if there is ssl.ctx.Maxim Dounin1-1/+1
This fixes segfault if stapling was enabled in a server without a certificate configured (and hence no ssl.ctx).
2012-10-03SSL: the "ssl_verify_client" directive parameter "optional_no_ca".Maxim Dounin1-1/+2
This parameter allows to don't require certificate to be signed by a trusted CA, e.g. if CA certificate isn't known in advance, like in WebID protocol. Note that it doesn't add any security unless the certificate is actually checked to be trusted by some external means (e.g. by a backend). Patch by Mike Kazantsev, Eric O'Connor.
2012-10-01OCSP stapling: ssl_stapling_verify directive.Maxim Dounin1-2/+11
OCSP response verification is now switched off by default to simplify configuration, and the ssl_stapling_verify allows to switch it on. Note that for stapling OCSP response verification isn't something required as it will be done by a client anyway. But doing verification on a server allows to mitigate some attack vectors, most notably stop an attacker from presenting some specially crafted data to all site clients.
2012-10-01OCSP stapling: loading OCSP responses.Maxim Dounin1-5/+56
This includes the ssl_stapling_responder directive (defaults to OCSP responder set in certificate's AIA extension). OCSP response for a given certificate is requested once we get at least one connection with certificate_status extension in ClientHello, and certificate status won't be sent in the connection in question. This due to limitations in the OpenSSL API (certificate status callback is blocking). Note: SSL_CTX_use_certificate_chain_file() was reimplemented as it doesn't allow to access the certificate loaded via SSL_CTX.
2012-10-01OCSP stapling: ssl_stapling_file support.Maxim Dounin1-0/+24
Very basic version without any OCSP responder query code, assuming valid DER-encoded OCSP response is present in a ssl_stapling_file configured. Such file might be produced with openssl like this: openssl ocsp -issuer root.crt -cert domain.crt -respout domain.staple \ -url http://ocsp.example.com
2012-10-01OCSP stapling: ssl_trusted_certificate directive.Maxim Dounin1-3/+21
The directive allows to specify additional trusted Certificate Authority certificates to be used during certificate verification. In contrast to ssl_client_certificate DNs of these cerificates aren't sent to a client during handshake. Trusted certificates are loaded regardless of the fact whether client certificates verification is enabled as the same certificates will be used for OCSP stapling, during construction of an OCSP request and for verification of an OCSP response. The same applies to a CRL (which is now always loaded).
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-11-14Fixed NGX_CONF_TAKE1/NGX_CONF_FLAG misuse.Sergey Budnevitch1-1/+1
2011-10-31Fixed segfault on configuration testing with ssl (ticket #37).Maxim Dounin1-1/+10
The following config caused segmentation fault due to conf->file not being properly set if "ssl on" was inherited from the http level: http { ssl on; server { } }
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/+17
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.