aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_request.c
Commit message (Collapse)AuthorAge
...
| * Fixed parsing of absolute URIs with empty path (ticket #2079).Maxim Dounin2020-12-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the request line contains request-target in the absolute-URI form, it can contain path-empty instead of a single slash (see RFC 7230, RFC 3986). Previously, the ngx_http_parse_request_line() function only accepted empty path when there was no query string. With this change, non-empty query is also correctly handled. That is, request line "GET http://example.com?foo HTTP/1.1" is accepted and results in $uri "/" and $args "foo". Note that $request_uri remains "?foo", similarly to how spaces in URIs are handled. Providing "/?foo", similarly to how "/" is provided for "GET http://example.com HTTP/1.1", requires allocation.
| * SSL: fixed SSL shutdown on lingering close.Ruslan Ermilov2020-12-08
| | | | | | | | | | | | | | Ensure c->recv is properly reset to ngx_recv if SSL_shutdown() blocks on writing. The bug had appeared in 554c6ae25ffc.
* | HTTP/3: eliminated r->method_start.Roman Arutyunyan2020-11-25
| | | | | | | | | | | | The field was introduced to ease parsing HTTP/3 requests. The change reduces diff to the default branch.
* | Merged with the default branch.Sergey Kandaurov2020-11-24
|\|
| * 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.
* | QUIC: renamed c->qs to c->quic.Roman Arutyunyan2020-11-10
| |
* | 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.
* | Merged with the default branch.Sergey Kandaurov2020-10-01
|\|
| * SSL: abort handshake on SSL_set_SSL_CTX() errors.Sergey Kandaurov2020-09-24
| | | | | | | | | | | | In rare cases, such as memory allocation failure, SSL_set_SSL_CTX() returns NULL, which could mean that a different SSL configuration has not been set. Note that this new behaviour seemingly originated in OpenSSL-1.1.0 release.
* | QUIC: moved ssl configuration pointer to quic configuration.Vladimir Homutov2020-10-01
| | | | | | | | The ssl configuration is obtained at config time and saved for future use.
* | QUIC: switch stream context to a server selected by SNI.Roman Arutyunyan2020-09-29
| | | | | | | | | | | | | | | | | | | | | | Previously the default server configuration context was used until the :authority or host header was parsed. This led to using the configuration parameters like client_header_buffer_size or request_pool_size from the default server rather than from the server selected by SNI. Also, the switch to the right server log is implemented. This issue manifested itself as QUIC stream being logged to the default server log until :authority or host is parsed.
* | QUIC: unbreak client certificate verification after 0d2b2664b41c.Sergey Kandaurov2020-09-23
| | | | | | | | | | | | | | | | Initially, client certificate verification didn't work due to the missing hc->ssl on a QUIC stream, which is started to be set in 7738:7f0981be07c4. Then it was lost in 7999:0d2b2664b41c introducing "quic" listen parameter. This change re-adds hc->ssl back for all QUIC connections, similar to SSL.
* | HTTP/3: drop the unwanted remainder of the request.Roman Arutyunyan2020-08-25
| | | | | | | | | | | | | | | | As per HTTP/3 draft 29, section 4.1: When the server does not need to receive the remainder of the request, it MAY abort reading the request stream, send a complete response, and cleanly close the sending part of the stream.
* | Merged with the default branch.Roman Arutyunyan2020-08-18
|\|
| * SSL: disabled sending shutdown after ngx_http_test_reading().Maxim Dounin2020-08-10
| | | | | | | | | | | | | | | | | | | | | | | | | | Sending shutdown when ngx_http_test_reading() detects the connection is closed can result in "SSL_shutdown() failed (SSL: ... bad write retry)" critical log messages if there are blocked writes. Fix is to avoid sending shutdown via the c->ssl->no_send_shutdown flag, similarly to how it is done in ngx_http_keepalive_handler() for kqueue when pending EOF is detected. Reported by Jan Prachaƙ (http://mailman.nginx.org/pipermail/nginx-devel/2018-December/011702.html).
| * Added size check to ngx_http_alloc_large_header_buffer().Maxim Dounin2020-08-06
| | | | | | | | | | | | | | | | | | This ensures that copying won't write more than the buffer size even if the buffer comes from hc->free and it is smaller than the large client header buffer size in the virtual host configuration. This might happen if size of large client header buffers is different in name-based virtual hosts, similarly to the problem with number of buffers fixed in 6926:e662cbf1b932.
* | QUIC: fixed ngx_http_test_reading() for QUIC streams.Roman Arutyunyan2020-08-11
| | | | | | | | | | | | | | | | | | | | | | | | Previously this function generated an error trying to figure out if client shut down the write end of the connection. The reason for this error was that a QUIC stream has no socket descriptor. However checking for eof is not the right thing to do for an HTTP/3 QUIC stream since HTTP/3 clients are expected to shut down the write end of the stream after sending the request. Now the function handles QUIC streams separately. It checks if c->read->error is set. The error flags for c->read and c->write are now set for all streams when closing the QUIC connection instead of setting the pending_eof flag.
* | HTTP/3: server pushes.Roman Arutyunyan2020-07-23
| | | | | | | | | | | | | | New directives are added: - http3_max_concurrent_pushes - http3_push - http3_push_preload
* | HTTP/3: support $server_protocol variable.Roman Arutyunyan2020-07-14
| | | | | | | | Now it holds "HTTP/3.0". Previously it was empty.
* | HTTP/3: do not call shutdown() for QUIC streams.Roman Arutyunyan2020-07-22
| | | | | | | | Previously, this triggered an alert "shutdown() failed" in error log.
* | QUIC: eliminated connection handler argument in ngx_quic_run().Roman Arutyunyan2020-07-21
| | | | | | | | Now c->listening->handler() is called instead.
* | QUIC: added "quic" listen parameter.Roman Arutyunyan2020-07-21
| | | | | | | | | | | | The parameter allows processing HTTP/0.9-2 over QUIC. Also, introduced ngx_http_quic_module and moved QUIC settings there
* | HTTP/3: set r->headers_in.chunked flag after parsing headers.Roman Arutyunyan2020-06-30
| | | | | | | | | | Previously it was set when creating the request object. The side-effect was trying to discard the request body in case of header parse error.
* | HTTP/3: close QUIC connection with HTTP/QPACK errors when needed.Roman Arutyunyan2020-07-02
| | | | | | | | | | | | | | | | Previously errors led only to closing streams. To simplify closing QUIC connection from a QUIC stream context, new macro ngx_http_v3_finalize_connection() is introduced. It calls ngx_quic_finalize_connection() for the parent connection.
* | HTTP/3: refactored dynamic table implementation.Roman Arutyunyan2020-07-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously dynamic table was not functional because of zero limit on its size set by default. Now the following changes enable it: - new directives to set SETTINGS_QPACK_MAX_TABLE_CAPACITY and SETTINGS_QPACK_BLOCKED_STREAMS - send settings with SETTINGS_QPACK_MAX_TABLE_CAPACITY and SETTINGS_QPACK_BLOCKED_STREAMS to the client - send Insert Count Increment to the client - send Header Acknowledgement to the client - evict old dynamic table entries on overflow - decode Required Insert Count from client - block stream if Required Insert Count is not reached
* | Decoupled validation of Host and :authority for HTTP/2 and HTTP/3.Roman Arutyunyan2020-06-02
| | | | | | | | | | Previously an error was triggered for HTTP/2 when host with port was passed by client.
* | Require ":authority" or "Host" in HTTP/3 and HTTP/2 requests.Roman Arutyunyan2020-05-29
| | | | | | | | | | | | | | | | | | | | Also, if both are present, require that they have the same value. These requirements are specified in HTTP/3 draft 28. Current implementation of HTTP/2 treats ":authority" and "Host" interchangeably. New checks only make sure at least one of these values is present in the request. A similar check existed earlier and was limited only to HTTP/1.1 in 38c0898b6df7.
* | Merged with the default branch.Sergey Kandaurov2020-05-26
|\|
| * SSL: client certificate validation with OCSP (ticket #1534).Roman Arutyunyan2020-05-22
| | | | | | | | | | | | | | | | | | 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.
* | Fixed client buffer reallocation for HTTP/3.Roman Arutyunyan2020-05-19
| | | | | | | | | | | | | | | | | | | | Preserving pointers within the client buffer is not needed for HTTP/3 because all data is either allocated from pool or static. Unlike with HTTP/1, data typically cannot be referenced directly within the client buffer. Trying to preserve NULLs or external pointers lead to broken pointers. Also, reverted changes in ngx_http_alloc_large_header_buffer() not relevant for HTTP/3 to minimize diff to mainstream.
* | Fixed $request_length for HTTP/3.Roman Arutyunyan2020-05-19
| | | | | | | | | | | | | | | | | | New field r->parse_start is introduced to substitute r->request_start and r->header_name_start for request length accounting. These fields only work for this purpose in HTTP/1 because HTTP/1 request line and header line start with these values. Also, error logging is now fixed to output the right part of the request.
* | HTTP/3: restricted symbols in header names.Roman Arutyunyan2020-05-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As per HTTP/3 draft 27, a request or response containing uppercase header field names MUST be treated as malformed. Also, existing rules applied when parsing HTTP/1 header names are also applied to HTTP/3 header names: - null character is not allowed - underscore character may or may not be treated as invalid depending on the value of "underscores_in_headers" - all non-alphanumeric characters with the exception of '-' are treated as invalid Also, the r->locase_header field is now filled while parsing an HTTP/3 header. Error logging for invalid headers is fixed as well.
* | HTTP/3: split header parser in two functions.Roman Arutyunyan2020-05-19
| | | | | | | | | | | | | | | | The first one parses pseudo-headers and is analagous to the request line parser in HTTP/1. The second one parses regular headers and is analogous to the header parser in HTTP/1. Additionally, error handling of client passing malformed uri is now fixed.
* | Assign connection number to every QUIC stream log.Roman Arutyunyan2020-04-23
| |
* | Merged with the default branch.Sergey Kandaurov2020-04-14
|\|
| * Simplified subrequest finalization.Roman Arutyunyan2020-02-28
| | | | | | | | | | Now it looks similar to what it was before background subrequests were introduced in 9552758a786e.
| * Fixed premature background subrequest finalization.Dmitry Volyntsev2020-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When "aio" or "aio threads" is used while processing the response body of an in-memory background subrequest, the subrequest could be finalized with an aio operation still in progress. Upon aio completion either parent request is woken or the old r->write_event_handler is called again. The latter may result in request errors. In either case post_subrequest handler is never called with the full response body, which is typically expected when using in-memory subrequests. Currently in nginx background subrequests are created by the upstream module and the mirror module. The issue does not manifest itself with these subrequests because they are header-only. But it can manifest itself with third-party modules which create in-memory background subrequests.
* | Parsing HTTP/3 request body.Roman Arutyunyan2020-03-27
| |
* | Removed ngx_quic_stream_node_t.Roman Arutyunyan2020-03-24
| | | | | | | | Now ngx_quic_stream_t is directly inserted into the tree.
* | QUIC streams don't need filter_need_in_memory after 7f0981be07c4.Sergey Kandaurov2020-03-24
| | | | | | | | | | Now they inherit c->ssl always enabled from the main connection, which makes r->main_filter_need_in_memory set for them.
* | Fixed client certificate verification.Sergey Kandaurov2020-03-23
| | | | | | | | | | | | For ngx_http_process_request() part to work, this required to set both r->http_connection->ssl and c->ssl on a QUIC stream. To avoid damaging global SSL object, ngx_ssl_shutdown() is managed to ignore QUIC streams.
* | Respect QUIC max_idle_timeout.Roman Arutyunyan2020-03-23
| |
* | Configurable transport parameters.Vladimir Homutov2020-03-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - integer parameters can be configured using the following directives: quic_max_idle_timeout quic_max_ack_delay quic_max_packet_size quic_initial_max_data quic_initial_max_stream_data_bidi_local quic_initial_max_stream_data_bidi_remote quic_initial_max_stream_data_uni quic_initial_max_streams_bidi quic_initial_max_streams_uni quic_ack_delay_exponent quic_active_migration quic_active_connection_id_limit - only following parameters are actually sent: active_connection_id_limit initial_max_streams_uni initial_max_streams_bidi initial_max_stream_data_bidi_local initial_max_stream_data_bidi_remote initial_max_stream_data_uni (other parameters are to be added into ngx_quic_create_transport_params() function as needed, should be easy now) - draft 24 and draft 27 are now supported (at compile-time using quic_version macro)
* | HTTP/3 $request_line variable.Roman Arutyunyan2020-03-18
| |
* | Refactored HTTP/3 parser.Roman Arutyunyan2020-03-18
| |
* | Temporary fix for header null-termination in HTTP/3.Roman Arutyunyan2020-03-14
| |
* | HTTP/3.Roman Arutyunyan2020-03-13
| |
* | Stream "connection" read/write methods.Vladimir Homutov2020-03-13
| |