summaryrefslogtreecommitdiffhomepage
path: root/src/http/modules/ngx_http_ssl_module.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-05-11HTTP/3: removed "http3" parameter of "listen" directive.Roman Arutyunyan1-1/+1
The parameter has been deprecated since c851a2ed5ce8.
2023-03-29Merged with the default branch.Sergey Kandaurov1-2/+3
2023-03-24SSL: enabled TLSv1.3 by default.Maxim Dounin1-2/+3
2023-03-24HTTP/3: fixed OpenSSL compatibility layer initialization.Sergey Kandaurov1-4/+36
SSL context is not present if the default server has neither certificates nor ssl_reject_handshake enabled. Previously, this led to null pointer dereference before it would be caught with configuration checks. Additionally, non-default servers with distinct SSL contexts need to initialize compatibility layer in order to complete a QUIC handshake.
2023-02-27HTTP/3: "quic" parameter of "listen" directive.Roman Arutyunyan1-11/+18
Now "listen" directve has a new "quic" parameter which enables QUIC protocol for the address. Further, to enable HTTP/3, a new directive "http3" is introduced. The hq-interop protocol is enabled by "http3_hq" as before. Now application protocol is chosen by ALPN. Previously used "http3" parameter of "listen" is deprecated.
2023-02-22QUIC: OpenSSL compatibility layer.Roman Arutyunyan1-3/+13
The change allows to compile QUIC with OpenSSL which lacks BoringSSL QUIC API. This implementation does not support 0-RTT.
2022-10-17SSL: improved validation of ssl_session_cache and ssl_ocsp_cache.Sergey Kandaurov1-2/+2
Now it properly detects invalid shared zone configuration with omitted size. Previously it used to read outside of the buffer boundary. Found with AddressSanitizer.
2022-10-20Merged with the default branch.Sergey Kandaurov1-2/+2
2022-01-26HTTP/3: removed draft versions support in ALPN.Sergey Kandaurov1-15/+0
2021-12-24Merged with the default branch.Ruslan Ermilov1-0/+3
2021-12-04HTTP/3: http3_hq directive and NGX_HTTP_V3_HQ macro.Roman Arutyunyan1-18/+23
Listen quic parameter is no longer supported.
2021-12-06HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.Roman Arutyunyan1-9/+6
2021-12-02HTTP/3: adjusted ALPN macro names to align with 61abb35bb8cf.Sergey Kandaurov1-4/+4
2021-11-01SSL: $ssl_curve (ticket #2135).Sergey Kandaurov1-0/+3
The variable contains a negotiated curve used for the handshake key exchange process. Known curves are listed by their names, unknown ones are shown in hex. Note that for resumed sessions in TLSv1.2 and older protocols, $ssl_curve contains the curve used during the initial handshake, while in TLSv1.3 it contains the curve used during the session resumption (see the SSL_get_negotiated_group manual page for details). The variable is only meaningful when using OpenSSL 3.0 and above. With older versions the variable is empty.
2021-11-03Merged with the default branch.Sergey Kandaurov1-56/+9
2021-09-29Fixed mismerge of ssl_reject_handshake in 71b7453fb11f.Sergey Kandaurov1-10/+11
In particular, this fixes rejecting "listen .. quic|http3" configurations without TLSv1.3 configured.
2021-09-01Merged with the default branch.Sergey Kandaurov1-7/+7
2021-10-20HTTP: connections with wrong ALPN protocols are now rejected.Vladimir Homutov1-7/+6
This is a recommended behavior by RFC 7301 and is useful for mitigation of protocol confusion attacks [1]. To avoid possible negative effects, list of supported protocols was extended to include all possible HTTP protocol ALPN IDs registered by IANA [2], i.e. "http/1.0" and "http/0.9". [1] https://alpaca-attack.com/ [2] https://www.iana.org/assignments/tls-extensiontype-values/
2021-10-14SSL: added $ssl_alpn_protocol variable.Vladimir Homutov1-0/+3
The variable contains protocol selected by ALPN during handshake and is empty otherwise.
2021-10-15HTTP/2: removed support for NPN.Vladimir Homutov1-54/+5
NPN was replaced with ALPN, published as RFC 7301 in July 2014. It used to negotiate SPDY (and, in transition, HTTP/2). NPN supported appeared in OpenSSL 1.0.1. It does not work with TLSv1.3 [1]. ALPN is supported since OpenSSL 1.0.2. The NPN support was dropped in Firefox 53 [2] and Chrome 51 [3]. [1] https://github.com/openssl/openssl/issues/3665. [2] https://bugzilla.mozilla.org/show_bug.cgi?id=1248198 [3] https://www.chromestatus.com/feature/5767920709795840
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-10Merged with the default branch.Sergey Kandaurov1-2/+2
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-12-22QUIC: fixed building ALPN callback without debug and http2.Sergey Kandaurov1-1/+1
2020-11-10QUIC: multiple versions support in ALPN.Sergey Kandaurov1-8/+27
Previously, a version based on NGX_QUIC_DRAFT_VERSION was always set. Now it is taken from the negotiated QUIC version that may differ.
2020-10-29Merged with the default branch.Sergey Kandaurov1-26/+97
2020-10-22SSL: ssl_reject_handshake directive (ticket #195).Maxim Dounin1-26/+65
In some cases it might be needed to reject SSL handshake based on SNI server name provided, for example, to make sure an invalid certificate is not returned to clients trying to contact a name-based virtual server without SSL configured. Previously, a "ssl_ciphers aNULL;" was used for this. This workaround, however, is not compatible with TLSv1.3, in particular, when using BoringSSL, where it is not possible to configure TLSv1.3 ciphers at all. With this change, the ssl_reject_handshake directive is introduced, which instructs nginx to reject SSL handshakes with an "unrecognized_name" alert in a particular server block. For example, to reject handshake with names other than example.com, one can use the following configuration: server { listen 443 ssl; ssl_reject_handshake on; } server { listen 443 ssl; server_name example.com; ssl_certificate example.com.crt; ssl_certificate_key example.com.key; } The following configuration can be used to reject all SSL handshakes without SNI server name provided: server { listen 443 ssl; ssl_reject_handshake on; } server { listen 443 ssl; server_name ~^; ssl_certificate example.crt; ssl_certificate_key example.key; } Additionally, the ssl_reject_handshake directive makes configuring certificates for the default server block optional. If no certificates are configured in the default server for a given listening socket, certificates must be defined in all non-default server blocks with the listening socket in question.
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.
2020-10-19QUIC: reverted previous 3 commits.Vladimir Homutov1-21/+0
Changes were intended for the test repository.
2020-09-15SSL: added the "ssl_keys_file" directive.Vladimir Homutov1-0/+21
2020-07-21QUIC: added "quic" listen parameter.Roman Arutyunyan1-8/+25
The parameter allows processing HTTP/0.9-2 over QUIC. Also, introduced ngx_http_quic_module and moved QUIC settings there
2020-05-26Merged with the default branch.Sergey Kandaurov1-5/+151
2020-05-22OCSP: certificate status cache.Roman Arutyunyan1-1/+93
When enabled, certificate status is stored in cache and is used to validate the certificate in future requests. New directive ssl_ocsp_cache is added to configure the cache.
2020-05-22SSL: client certificate validation with OCSP (ticket #1534).Roman Arutyunyan1-5/+59
OCSP validation for client certificates is enabled by the "ssl_ocsp" directive. OCSP responder can be optionally specified by "ssl_ocsp_responder". When session is reused, peer chain is not available for validation. If the verified chain contains certificates from the peer chain not available at the server, validation will fail.
2020-03-23Support for HTTP/3 ALPN.Roman Arutyunyan1-2/+10
This is required by Chrome.
2020-03-18Moved setting QUIC methods to runtime.Roman Arutyunyan1-14/+0
This allows listening to both https and http3 in the same server. Also, the change eliminates the ssl_quic directive.
2020-02-28Cleanup.Sergey Kandaurov1-3/+0
2020-02-28Initial QUIC support in http.Sergey Kandaurov1-1/+26
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-8/+9
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: 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.