aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
...
* | Merged with the default branch.Sergey Kandaurov2020-11-24
|\|
| * gRPC: RST_STREAM(NO_ERROR) handling after "trailer only" responses.Pavel Pautov2020-11-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similarly to the problem fixed in 2096b21fcd10 (ticket #1792), when a "trailer only" gRPC response (that is, a response with the END_STREAM flag in the HEADERS frame) was immediately followed by RST_STREAM(NO_ERROR) in the data preread along with the response header, RST_STREAM wasn't properly skipped and caused "upstream rejected request with error 0" errors. Observed with "unknown service" gRPC errors returned by grpc-go. Fix is to set ctx->done if we are going to parse additional data, so the RST_STREAM(NO_ERROR) is properly skipped. Additionally, now ngx_http_grpc_filter() will complain about frames sent for closed stream if there are any.
| * Core: "-e" command line option.Igor Ippolitov2020-11-19
| | | | | | | | | | | | | | | | | | When installing or running from a non-root user it is sometimes required to override default, compiled in error log path. There was no way to do this without rebuilding the binary (ticket #147). This patch introduced "-e" command line option which allows one to override compiled in error log path.
| * Request body: removed error assumption (ticket #2058).Maxim Dounin2020-11-09
| | | | | | | | | | | | | | | | | | | | | | | | | | Before introduction of request body filter in 42d9beeb22db, the only possible return code from the ngx_http_request_body_filter() call without actual buffers was NGX_HTTP_INTERNAL_SERVER_ERROR, and the code in ngx_http_read_client_request_body() hardcoded the only possible error to simplify the code of initial call to set rb->rest. This is no longer true after introduction of request body filters though, as a request body filter might need to return other errors, such as 403. Fix is to preserve the error code actually returned by the call instead of assuming 500.
| * Request body: improved logging.Maxim Dounin2020-11-09
| | | | | | | | | | | | | | Added logging before returning NGX_HTTP_INTERNAL_SERVER_ERROR if there are busy buffers after a request body flush. This should never happen with current code, though bugs can be introduced by 3rd party modules. Make sure debugging will be easy enough.
| * SSL: fixed non-working SSL shutdown on lingering close.Ruslan Ermilov2020-11-06
| | | | | | | | | | | | | | | | When doing lingering close, the socket was first shut down for writing, so SSL shutdown initiated after lingering close was not able to send the close_notify alerts (ticket #2056). The fix is to call ngx_ssl_shutdown() before shutting down the socket.
| * Removed dead code from ngx_http_set_keepalive().Ruslan Ermilov2020-11-06
| | | | | | | | | | The code removed became dead after 98f03cd8d6cc (0.8.14), circa when the request reference counting was introduced.
| * Core: added format specifiers to output binary data as hex.Vladimir Homutov2020-10-28
| | | | | | | | | | | | | | Now "s", "V", and "v" format specifiers may be prefixed with "x" (lowercase) or "X" (uppercase) to output corresponding data in hexadecimal format. In collaboration with Maxim Dounin.
| * Version bump.Vladimir Homutov2020-11-05
| |
* | QUIC: rejecting zero-length packets with PROTOCOL_VIOLATION.Sergey Kandaurov2020-11-18
| | | | | | | | | | Per the latest post draft-32 specification updates on the topic: https://github.com/quicwg/base-drafts/pull/4391
* | QUIC: simplified and streamlined ngx_quic_decrypt().Sergey Kandaurov2020-11-17
| | | | | | | | | | Both clearflags and badflags are removed. It makes a little sense now to keep them as intermediate storage.
* | QUIC: merged create_long/short_packet() functions.Sergey Kandaurov2020-11-17
| | | | | | | | They no longer differ.
* | QUIC: macros for manipulating header protection and reserved bits.Sergey Kandaurov2020-11-17
| | | | | | | | | | This gets rid of magic numbers from quic protection and allows to push down header construction specifics further to quic transport.
* | QUIC: hide header creation internals in ngx_event_quic_transport.c.Sergey Kandaurov2020-11-17
| | | | | | | | It doesn't make sense to expose the header type in a public function.
* | QUIC: refactored long header parsing.Sergey Kandaurov2020-11-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The largely duplicate type-specific functions ngx_quic_parse_initial_header(), ngx_quic_parse_handshake_header(), and a missing one for 0-RTT, were merged. The new order of functions listed in ngx_event_quic_transport.c reflects this. |_ ngx_quic_parse_long_header - version-invariant long header fields \_ ngx_quic_supported_version - a helper to decide we can go further \_ ngx_quic_parse_long_header_v1 - QUICv1-specific long header fields 0-RTT packets previously appeared as Handshake are now logged as appropriate: *1 quic packet rx long flags:db version:ff00001d *1 quic packet rx early len:870 Logging SCID/DCID is no longer duplicated as were seen with Initial packets.
* | QUIC: sorted header parsing functions in order of appearance.Sergey Kandaurov2020-11-17
| | | | | | | | No functional changes.
* | QUIC: removed macros for stream limits unused since c5324bb3a704.Sergey Kandaurov2020-11-17
| |
* | Core: hide "struct ngx_quic_connection_s" and further reduce diffs.Sergey Kandaurov2020-11-13
| | | | | | | | | | As with the previous change, it became feasible with feec2cc762f6 that removes ngx_quic_connection_t from ngx_connection_s.
* | Core: reduced diff to the default branch.Sergey Kandaurov2020-11-13
| | | | | | | | | | It became feasible to reduce after feec2cc762f6 that removes ngx_quic_connection_t from ngx_connection_s.
* | QUIC: microoptimization in varint parsing.Sergey Kandaurov2020-11-13
| | | | | | | | Removed a useless mask from the value being shifted, since it is 1-byte wide.
* | Fixed generating chunked response after 46e3542d51b3.Roman Arutyunyan2020-11-10
| | | | | | | | | | | | | | | | If trailers were missing and a chain carrying the last_buf flag had no data in it, then last HTTP/1 chunk was broken. The problem was introduced while implementing HTTP/3 response body generation. The change fixes the issue and reduces diff to the mainline nginx.
* | QUIC: generate default stateless reset token key.Roman Arutyunyan2020-11-11
| | | | | | | | | | | | | | | | | | | | | | Previously, if quic_stateless_reset_token_key was empty or unspecified, initial stateless reset token was not generated. However subsequent tokens were generated with empty key, which resulted in error with certain SSL libraries, for example OpenSSL. Now a random 32-byte stateless reset token key is generated if none is specified in the configuration. As a result, stateless reset tokens are now generated for all server ids.
* | QUIC: removed comment.Roman Arutyunyan2020-11-11
| |
* | QUIC: added quic_stateless_reset_token_key Stream directive.Roman Arutyunyan2020-11-11
| | | | | | | | A similar directive is already available in HTTP.
* | QUIC: reallocate qc->dcid on retry.Roman Arutyunyan2020-11-11
| | | | | | | | | | | | | | | | Previously new dcid was generated in the same memory that was allocated for qc->dcid when creating the QUIC connection. However this memory was also referenced by initial_source_connection_id and retry_source_connection_id transport parameters. As a result these parameters changed their values after retry which broke the protocol.
* | QUIC: renamed c->qs to c->quic.Roman Arutyunyan2020-11-10
| |
* | QUIC: got rid of the c->quic field.Roman Arutyunyan2020-11-10
| | | | | | | | Now QUIC connection is accessed via the c->udp field.
* | QUIC: connection multiplexing per port.Roman Arutyunyan2020-11-11
| | | | | | | | Also, connection migration within a single worker is implemented.
* | QUIC: renamed field and function related to client ids.Roman Arutyunyan2020-11-09
| | | | | | | | | | Particularly, c->curr_seqnum is renamed to c->client_seqnum and ngx_quic_alloc_connection_id() is renamed to ngx_quic_alloc_client_id().
* | QUIC: multiple versions support in ALPN.Sergey Kandaurov2020-11-10
| | | | | | | | | | Previously, a version based on NGX_QUIC_DRAFT_VERSION was always set. Now it is taken from the negotiated QUIC version that may differ.
* | QUIC: multiple versions support.Sergey Kandaurov2020-11-10
| | | | | | | | Draft-29 and beyond are now treated as compatible versions.
* | QUIC: preparatory changes for multiple QUIC versions support.Sergey Kandaurov2020-11-10
| | | | | | | | | | | | | | | | | | | | A negotiated version is decoupled from NGX_QUIC_VERSION and, if supported, now stored in c->quic->version after packets processing. It is then used to create long header packets. Otherwise, the list of supported versions (which may be many now) is sent in the Version Negotiation packet. All packets in the connection are expected to have the same version. Incoming packets with mismatched version are now rejected.
* | QUIC: added proper logging of special values.Vladimir Homutov2020-11-06
| | | | | | | | | | | | | | | | A number of unsigned variables has a special value, usually -1 or some maximum, which produces huge numeric value in logs and makes them hard to read. In order to distinguish such values in log, they are casted to the signed type and printed as literal '-1'.
* | QUIC: fixed address validation issues in a new connection.Sergey Kandaurov2020-11-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The client address validation didn't complete with a valid token, which was broken after packet processing refactoring in d0d3fc0697a0. An invalid or expired token was treated as a connection error. Now we proceed as outlined in draft-ietf-quic-transport-32, section 8.1.3 "Address Validation for Future Connections" below, which is unlike validating the client address using Retry packets. When a server receives an Initial packet with an address validation token, it MUST attempt to validate the token, unless it has already completed address validation. If the token is invalid then the server SHOULD proceed as if the client did not have a validated address, including potentially sending a Retry. The connection is now closed in this case on internal errors only.
* | QUIC: refactored key handling.Sergey Kandaurov2020-11-02
| | | | | | | | | | | | | | | | | | | | All key handling functionality is moved into ngx_quic_protection.c. Public structures from ngx_quic_protection.h are now private and new methods are available to manipulate keys. A negotiated cipher is cached in QUIC connection from the set secret callback to avoid calling SSL_get_current_cipher() on each encrypt/decrypt operation. This also reduces the number of unwanted c->ssl->connection occurrences.
* | QUIC: refactored SSL_do_handshake() handling.Sergey Kandaurov2020-10-29
| | | | | | | | No functional changes.
* | QUIC: passing ssl_conn to SSL_get0_alpn_selected() directly.Sergey Kandaurov2020-10-29
| | | | | | | | No functional changes.
* | Merged with the default branch.Sergey Kandaurov2020-10-29
|\|
| * SSL: ssl_reject_handshake directive (ticket #195).Maxim Dounin2020-10-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Stream: proxy_ssl_conf_command directive.Maxim Dounin2020-10-22
| | | | | | | | | | | | | | | | | | Similarly to ssl_conf_command, proxy_ssl_conf_command can be used to set arbitrary OpenSSL configuration parameters as long as nginx is compiled with OpenSSL 1.0.2 or later, when connecting to upstream servers with SSL. 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).
| * Upstream: proxy_ssl_conf_command and friends.Maxim Dounin2020-10-22
| | | | | | | | | | | | | | | | | | Similarly to ssl_conf_command, proxy_ssl_conf_command (grpc_ssl_conf_command, uwsgi_ssl_conf_command) can be used to set arbitrary OpenSSL configuration parameters as long as nginx is compiled with OpenSSL 1.0.2 or later, when connecting to upstream servers with SSL. 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).
| * 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.
| * Core: ngx_conf_set_keyval_slot() now accepts NGX_CONF_UNSET_PTR.Maxim Dounin2020-10-22
| | | | | | | | | | | | | | | | | | | | With this change, it is now possible to use ngx_conf_merge_ptr_value() to merge keyval arrays. This change actually follows much earlier changes in ngx_conf_merge_ptr_value() and ngx_conf_set_str_array_slot() in 1452:cd586e963db0 (0.6.10) and 1701:40d004d95d88 (0.6.22). To preserve compatibility with existing 3rd party modules, both NULL and NGX_CONF_UNSET_PTR are accepted for now.
| * Cpp test: added stream.Ruslan Ermilov2020-10-13
| |
| * Limit req: unlocking of nodes on complex value errors.Maxim Dounin2020-10-08
| | | | | | | | | | | | | | | | Previously, if there were multiple limits configured, errors in ngx_http_complex_value() during processing of a non-first limit resulted in reference count leak in shared memory nodes of already processed limits. Fix is to explicity unlock relevant nodes, much like we do when rejecting requests.
| * Mail: proxy_smtp_auth directive.Maxim Dounin2020-10-03
| | | | | | | | | | | | | | | | | | The proxy_smtp_auth directive instructs nginx to authenticate users on backend via the AUTH command (using the PLAIN SASL mechanism), similar to what is normally done for IMAP and POP3. If xclient is enabled along with proxy_smtp_auth, the XCLIENT command won't try to send the LOGIN parameter.
| * Version bump.Maxim Dounin2020-10-03
| |
* | QUIC: handle more frames in ngx_quic_resend_frames().Roman Arutyunyan2020-10-29
| | | | | | | | | | When a packet is declared lost, its frames are handled differently according to 13.3. Retransmission of Information.
* | QUIC: avoided retransmission of stale ack frames.Vladimir Homutov2020-10-28
| | | | | | | | Acknowledgments are regenerated using the most recent data available.
* | QUIC: changed STREAM frame debugging.Roman Arutyunyan2020-10-27
| |