<feed xmlns='http://www.w3.org/2005/Atom'>
<title>nginx.git/src/stream, branch release-1.23.1</title>
<subtitle>nginx</subtitle>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/'/>
<entry>
<title>Upstream: optimized use of SSL contexts (ticket #1234).</title>
<updated>2022-06-28T23:47:45+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2022-06-28T23:47:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=d791b4aab418b0cbadbaf079fbb9360269d97941'/>
<id>d791b4aab418b0cbadbaf079fbb9360269d97941</id>
<content type='text'>
To ensure optimal use of memory, SSL contexts for proxying are now
inherited from previous levels as long as relevant proxy_ssl_* directives
are not redefined.

Further, when no proxy_ssl_* directives are redefined in a server block,
we now preserve plcf-&gt;upstream.ssl in the "http" section configuration
to inherit it to all servers.

Similar changes made in uwsgi, grpc, and stream proxy.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
To ensure optimal use of memory, SSL contexts for proxying are now
inherited from previous levels as long as relevant proxy_ssl_* directives
are not redefined.

Further, when no proxy_ssl_* directives are redefined in a server block,
we now preserve plcf-&gt;upstream.ssl in the "http" section configuration
to inherit it to all servers.

Similar changes made in uwsgi, grpc, and stream proxy.
</pre>
</div>
</content>
</entry>
<entry>
<title>Stream: don't flush empty buffers created for read errors.</title>
<updated>2022-05-23T18:29:44+00:00</updated>
<author>
<name>Aleksei Bavshin</name>
<email>a.bavshin@f5.com</email>
</author>
<published>2022-05-23T18:29:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=d7994be44592f0ce9c240406b13020cdc377a9f0'/>
<id>d7994be44592f0ce9c240406b13020cdc377a9f0</id>
<content type='text'>
When we generate the last_buf buffer for an UDP upstream recv error, it does
not contain any data from the wire. ngx_stream_write_filter attempts to forward
it anyways, which is incorrect (e.g., UDP upstream ECONNREFUSED will be
translated to an empty packet).

This happens because we mark the buffer as both 'flush' and 'last_buf', and
ngx_stream_write_filter has special handling for flush with certain types of
connections (see d127837c714f, 32b0ba4855a6).  The flags are meant to be
mutually exclusive, so the fix is to ensure that flush and last_buf are not set
at the same time.

Reproduction:

stream {
    upstream unreachable {
        server     127.0.0.1:8880;
    }
    server {
        listen     127.0.0.1:8998 udp;
        proxy_pass unreachable;
    }
}

1 0.000000000    127.0.0.1 → 127.0.0.1    UDP 47 45588 → 8998 Len=5
2 0.000166300    127.0.0.1 → 127.0.0.1    UDP 47 51149 → 8880 Len=5
3 0.000172600    127.0.0.1 → 127.0.0.1    ICMP 75 Destination unreachable (Port
unreachable)
4 0.000202400    127.0.0.1 → 127.0.0.1    UDP 42 8998 → 45588 Len=0

Fixes d127837c714f.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When we generate the last_buf buffer for an UDP upstream recv error, it does
not contain any data from the wire. ngx_stream_write_filter attempts to forward
it anyways, which is incorrect (e.g., UDP upstream ECONNREFUSED will be
translated to an empty packet).

This happens because we mark the buffer as both 'flush' and 'last_buf', and
ngx_stream_write_filter has special handling for flush with certain types of
connections (see d127837c714f, 32b0ba4855a6).  The flags are meant to be
mutually exclusive, so the fix is to ensure that flush and last_buf are not set
at the same time.

Reproduction:

stream {
    upstream unreachable {
        server     127.0.0.1:8880;
    }
    server {
        listen     127.0.0.1:8998 udp;
        proxy_pass unreachable;
    }
}

1 0.000000000    127.0.0.1 → 127.0.0.1    UDP 47 45588 → 8998 Len=5
2 0.000166300    127.0.0.1 → 127.0.0.1    UDP 47 51149 → 8880 Len=5
3 0.000172600    127.0.0.1 → 127.0.0.1    ICMP 75 Destination unreachable (Port
unreachable)
4 0.000202400    127.0.0.1 → 127.0.0.1    UDP 42 8998 → 45588 Len=0

Fixes d127837c714f.
</pre>
</div>
</content>
</entry>
<entry>
<title>Upstream: handling of certificates specified as an empty string.</title>
<updated>2022-06-07T16:08:57+00:00</updated>
<author>
<name>Sergey Kandaurov</name>
<email>pluknet@nginx.com</email>
</author>
<published>2022-06-07T16:08:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=f08dbefadf083b8546423e35d8d12ba27e46efa8'/>
<id>f08dbefadf083b8546423e35d8d12ba27e46efa8</id>
<content type='text'>
Now, if the directive is given an empty string, such configuration cancels
loading of certificates, in particular, if they would be otherwise inherited
from the previous level.  This restores previous behaviour, before variables
support in certificates was introduced (3ab8e1e2f0f7).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now, if the directive is given an empty string, such configuration cancels
loading of certificates, in particular, if they would be otherwise inherited
from the previous level.  This restores previous behaviour, before variables
support in certificates was introduced (3ab8e1e2f0f7).
</pre>
</div>
</content>
</entry>
<entry>
<title>HTTP/2: made it possible to flush response headers (ticket #1743).</title>
<updated>2022-02-02T22:44:38+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2022-02-02T22:44:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=a52433a04c58821fd95591e474d35995292f1090'/>
<id>a52433a04c58821fd95591e474d35995292f1090</id>
<content type='text'>
Response headers can be buffered in the SSL buffer.  But stream's fake
connection buffered flag did not reflect this, so any attempts to flush
the buffer without sending additional data were stopped by the write filter.

It does not seem to be possible to reflect this in fc-&gt;buffered though, as
we never known if main connection's c-&gt;buffered corresponds to the particular
stream or not.  As such, fc-&gt;buffered might prevent request finalization
due to sending data on some other stream.

Fix is to implement handling of flush buffers when the c-&gt;need_flush_buf
flag is set, similarly to the existing last buffer handling.  The same
flag is now used for UDP sockets in the stream module instead of explicit
checking of c-&gt;type.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Response headers can be buffered in the SSL buffer.  But stream's fake
connection buffered flag did not reflect this, so any attempts to flush
the buffer without sending additional data were stopped by the write filter.

It does not seem to be possible to reflect this in fc-&gt;buffered though, as
we never known if main connection's c-&gt;buffered corresponds to the particular
stream or not.  As such, fc-&gt;buffered might prevent request finalization
due to sending data on some other stream.

Fix is to implement handling of flush buffers when the c-&gt;need_flush_buf
flag is set, similarly to the existing last buffer handling.  The same
flag is now used for UDP sockets in the stream module instead of explicit
checking of c-&gt;type.
</pre>
</div>
</content>
</entry>
<entry>
<title>SSL: $ssl_curve (ticket #2135).</title>
<updated>2021-11-01T15:09:34+00:00</updated>
<author>
<name>Sergey Kandaurov</name>
<email>pluknet@nginx.com</email>
</author>
<published>2021-11-01T15:09:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=5c3249964403356601e64ab701f2e563a1f98630'/>
<id>5c3249964403356601e64ab701f2e563a1f98630</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Style: added missing "static" specifiers.</title>
<updated>2021-10-21T15:43:13+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2021-10-21T15:43:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=3ab1b64463cfc1cea5209f159d8fe3797328be51'/>
<id>3ab1b64463cfc1cea5209f159d8fe3797328be51</id>
<content type='text'>
Mostly found by gcc -Wtraditional, per "non-static declaration of ...
follows static declaration [-Wtraditional]" warnings.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Mostly found by gcc -Wtraditional, per "non-static declaration of ...
follows static declaration [-Wtraditional]" warnings.
</pre>
</div>
</content>
</entry>
<entry>
<title>Stream: the "ssl_alpn" directive.</title>
<updated>2021-10-19T09:19:59+00:00</updated>
<author>
<name>Vladimir Homutov</name>
<email>vl@nginx.com</email>
</author>
<published>2021-10-19T09:19:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=df472eecc043700275ecae2655206163c786f758'/>
<id>df472eecc043700275ecae2655206163c786f758</id>
<content type='text'>
The directive sets the server list of supported application protocols
and requires one of this protocols to be negotiated if client is using
ALPN.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The directive sets the server list of supported application protocols
and requires one of this protocols to be negotiated if client is using
ALPN.
</pre>
</div>
</content>
</entry>
<entry>
<title>SSL: added $ssl_alpn_protocol variable.</title>
<updated>2021-10-14T08:46:23+00:00</updated>
<author>
<name>Vladimir Homutov</name>
<email>vl@nginx.com</email>
</author>
<published>2021-10-14T08:46:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=a9f4f25b72c39653795dfb4b1f13b55625fb9fbc'/>
<id>a9f4f25b72c39653795dfb4b1f13b55625fb9fbc</id>
<content type='text'>
The variable contains protocol selected by ALPN during handshake and
is empty otherwise.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The variable contains protocol selected by ALPN during handshake and
is empty otherwise.
</pre>
</div>
</content>
</entry>
<entry>
<title>Stream: added half-close support.</title>
<updated>2021-09-22T07:20:00+00:00</updated>
<author>
<name>Vladimir Homutov</name>
<email>vl@nginx.com</email>
</author>
<published>2021-09-22T07:20:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=e56ba23158b8466d108fd4d571bd7d9a88f2a473'/>
<id>e56ba23158b8466d108fd4d571bd7d9a88f2a473</id>
<content type='text'>
The "proxy_half_close" directive enables handling of TCP half close.  If
enabled, connection to proxied server is kept open until both read ends get
EOF.  Write end shutdown is properly transmitted via proxy.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The "proxy_half_close" directive enables handling of TCP half close.  If
enabled, connection to proxied server is kept open until both read ends get
EOF.  Write end shutdown is properly transmitted via proxy.
</pre>
</div>
</content>
</entry>
<entry>
<title>SSL: ciphers now set before loading certificates (ticket #2035).</title>
<updated>2021-08-16T19:40:31+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2021-08-16T19:40:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=ce5996cdd1b2e150f645efbc337e5a681dbe241c'/>
<id>ce5996cdd1b2e150f645efbc337e5a681dbe241c</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
</feed>
