GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Support boringssl SSLCredential API by jmcrawford45 · Pull Request #15906 · netty/netty

Conversation

@jmcrawford45

@jmcrawford45 jmcrawford45 commented Nov 20, 2025

Copy link
Copy Markdown
Contributor

Motivation:

Historically, BoringSSL lacked a built-in method to select between RSA and ECDSA certificates. The selection process, especially at TLS 1.2, is quite complex, as detailed in this link. TLS 1.3 simplifies this process significantly. Additionally, within ECDSA, there are different curves to consider, and future developments will introduce post-quantum key types. The SSL Credential API was introduced to BoringSSL to address this and a variety of other certificate negotiation decisions, such as:

Different kinds of credentials (delegate credentials, raw public keys, external PSKs, and more future innovations.
Negotiation for trust anchors to aid in PQ transitions and PKI agility.

Modification:

Introduce high level APIs leveraging the bindings introduced in netty/netty-tcnative#935

OpenSslCredential credential = OpenSslCredentialBuilder.newX509()
    .privateKey(privateKey)
    .certificateChain(cert1, cert2, cert3)
    .ocspResponse(ocspBytes)
    .signedCertificateTimestamps(sctBytes)
    .signingAlgorithmPreferences(preferenceBytes)
    .certificateProperties(propsBytes)
    .trustAnchorId(anchorId)
    .mustMatchIssuer(true)
    .build();

Result:

There are two main immediate use cases to this API
First, it is now possible to delegate all the complexity of EC/RSA serving to BoringSSL.

OpenSslCredential ecdsaCred = buildEcdsaCredential();

SslContext ctx = SslContextBuilder.forServer(rsaKey, rsaCert)
    .sslProvider(SslProvider.OPENSSL_REFCNT)
    .credential(ecdsaCred)
    .build();

This mechanism will also be useful to allow clients to negotiate trust anchors via https://github.com/tlswg/tls-trust-anchor-ids. For example, a modern client may request for a more efficient or more secure chain while legacy clients can still receive the less secure / less efficient fallback cert.

depends on https://github.com/jmcrawford45/netty-tcnative/tree/ssl-credential-fixups

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
chrisvest and others added 30 commits April 25, 2024 16:12
@chrisvest
Update JUnit and make use of @AutoClose (netty#14000)
421bac2
Motivation:
JUnit put out a milestone release so people could test it. It's
potentially interesting, so let's give it a try.

Modification:
Update JUnit to 5.11.0-M1.
Replace a number of obvious `@AfterEach/All` methods with `@AutoClose`
field annotations.

Result:
Cleaner test code.
@chrisvest
Update BouncyCastle and Revapi (netty#14005)
5f5dcdc
This is a simple forward port of netty#14003 but we don't need to worry about
compatibility because Netty 5 is a new major version.
@yawkat @chrisvest
Support bc-fips in BouncyCastleSelfSignedCertGenerator (netty#13954)
f6a4533
Motivation:

When using the bouncycastle FIPS dependencies (bcpkix-fips instead of
bcpkix, and bc-fips instead of bcprov), BouncyCastleProvider is replaced
by BouncyCastleFipsProvider. This made
BouncyCastleSelfSignedCertGenerator fail even though all the necessary
algorithms are present.

While bc-fips is only necessary for fips-compliant production
deployments, and self-signed certs are only necessary in test
deployments that don't have to be fips-compliant, this change is still
useful because the fips and non-fips artifacts cannot exist alongside
each other. So if you have a prod fips dependency, tests that also have
a non-fips dependency for self-signed certs cannot live alongside each
other. It's easiest to just use the fips dependency everywhere.

Modification:

Use reflection in BouncyCastleSelfSignedCertGenerator to instantiate
whichever provider is available. This has the advantage of not needing a
new dependency, though it may have some impact on native image
deployments. For this reason I've also added the providers to the
reflect-config.json.

No test is possible because it would require a different classpath. I
tested manually that it works by changing to the fips dependencies and
then running SelfSignedCertificateTest, and checking with a debugger
that the correct provider was used.

Result:

SelfSignedCertificate will work with bc-fips dependencies.
@normanmaurer @chrisvest
Add more JDK versions to the devcontainers (netty#14008)
acd6c18
Motivation:

We should add also other JDKs to the docker images that are used by
devcontainers so its easier to debug with different JDKs

Modifications:

Add Java 8,11,17

Result:

Easier to debug with devcontainers

---------

Co-authored-by: Chris Vest <[email protected]>
@normanmaurer
Remove usage of japicmp-maven-plugin (netty#14015)
6be07ca
Motivation:

Let's remove the usage of japicmp-maven-plugin and just use revapi.

Modifications:

Remove usage of japicmp-maven-plugin

Result:

Cleanup
@hezhangjian @normanmaurer
build: update slf4j from 1.x to 2.0.13, logback to 1.3.14 (netty#14016)
1d86f61
Update slf4j to 2.x, logback to 1.3.14. This is a backward-compatible
change.

SLF4J API version 2.0.0 requires Java 8 and introduces a
backward-compatible fluent logging API. By backward-compatible, we mean
that existing logging frameworks do not have to be changed in order for
the user to benefit from the fluent logging API.

Version 1.3.x supports Java EE, while version 1.4.x supports Jakarta EE.
The two versions are feature identical.

Both 1.3.x and 1.4.x series require SLF4J 2.0.x or later.

The 1.3.x series requires Java 8 at runtime.

Result:

Fixes netty#14011

Signed-off-by: ZhangJian He <[email protected]>
@normanmaurer
Move factory methods to IOUringHandler (netty#14023)
f7eb1e7
Motivation:

In all our other transport implementations we have the factory methods
in the IoHandler implementation itself. Let's be consistent

Modifications:

Move methods from IOUring to IOUringHandler.

Result:

More consistent API
@chrisvest
Remove Jetty NPN and ALPN support (netty#14049)
b619a06
Motivation:
At this point, the JDK and OpenSSL both natively support ALPN, which
effectively means that ALPN is always available. NPN itself has been
obsolete for nearly 15 years, since the release of ALPN and its
subsequent widespread support. We no longer need Jetty to do ALPN or NPN
for us.

Modification:
Remove all code, build properties, and dependencies related to Jetty NPN
and ALPN.

Result:
This removes deprecated code and obsoleted features, and makes our
pom.xml files cleaner.
@chrisvest @normanmaurer
Remove forbidden-apis and dev-tools (netty#14048)
0b10894
Motivation:
These maven plugins are disabled in all our profiles anyway.

Modification:
- Remove the forbidden-apis plugin.
- Also remove dev-tools module and remote-resources plugin, because they
were only there to support forbidden-apis.

Result:
Less cruft in our maven poms.

Co-authored-by: Norman Maurer <[email protected]>
@franz1981
AdaptivePoolingAllocator EventLoop Magazine's affinity (netty#14047)
c77c02e
@chrisvest
Remove references to ByteBuf and update buffer package docs (netty#14066
abaf9d3
)

Motivation:
Netty 5 uses a Buffer interface instead of the ByteBuf from Netty 4.
Some of our javadocs are out of date, or have been forward-ported
without being updated.

Modification:
- Remove all references to ByteBuf.
- Update the `io.netty5.buffer` package documentation.
- Update the `PoolChunk` javadocs.

Result:
More up to date documentation of our buffers.

Fixes netty#14062
@thxwelchs @normanmaurer
Add support for specifying SecureRandom in SSLContext initialization (n…
f3ff91c
…etty#14058)

Motivation:

Enhance security by supporting specific secure randomness source in
SSLContext initialization

Modification:

Support building SecureRandom in `SslContextBuilder`.
Allow passing SecureRandom as a parameter when creating an instance of
`JdkSslServerContext` through its constructor.

Result:

Enhance security

Fixes netty#14026

---------

Co-authored-by: Norman Maurer <[email protected]>
@normanmaurer
Port EventLoop / EventLoopGroup changes to main (netty#14053)
538a21c
Motivation:

While working on 4.2 we introduced some change to EventLoop/
EventLoopGroup. We need to forward port these

Modifications:

Port changes

Result:

Port changes to main
@croister @normanmaurer
Remove unwanted mandatory dependency in OSGi (netty#14082)
7c67bc5
Motivation:

The BouncyCastle bc-fips dependency was inadvertently added as a
mandatory dependency by:

netty@d868c7b
The intention of the commit was to make it possible to replace bcpkix
and bcprov with bcpkix-fips and bc-fips.
Because bc-prov is not added as a depenency in the pom file the
mave-bundle-plugin defaults to make it mandatory.

Modification:

Add maven-bundle-plugin configuration to make bc-fips optional in OSGi
deployments like all other BouncyCastle bundles are.

Result:

The netty-handler bundle has a optional dependency instead of a
mandatory dependency on bc-fips in OSGi deployments.

Fixes netty#14080.
@normanmaurer
HashedWheelTimer.stop() must cancel tasks. (netty#14083)
b442431
Motivation:

HashedWheelTimer must mark all tasks that were not processed as
cancelled before returning them.

Modifications:

- Cancel tasks
- Add unit test

Result:

Fixes netty#14081
@normanmaurer @chrisvest
Add missing NULL checks in native code (netty#14100)
446c7a7
Motivation:

We didn't have all the necessary NULL checks in place which could cause
a segfault when an operation failed in native code due an OOME (for
example).

Modifications:

Add missing NULL checks

Result:

Correctly handle error scenarios

---------

Co-authored-by: Chris Vest <[email protected]>
@normanmaurer
Add release workflow for 4.2 branch (netty#14108)
e0b8941
Motivation:

We are on our way to release netty 4.2.0. We need a workflow for it

Modifications:

Add workflow that can be used to release netty 4.2.x

Result:

Be able to cut a release of netty 4.2.x
@normanmaurer
Use unique naming for release workflows
ffe9adc
@normanmaurer
Allow control frames between fragments (netty#14122)
b7a2a30
Motivation:

In WebSockets control frames are allowed to be send between fragments.

Modifications:

Allow all control frames to be send in between (only PING was handled)

Result:

Fixes netty#14118
@normanmaurer @chrisvest
Default hostname validation, configured via SslContextBuilder (netty#…
526cbe8
…14127) (netty#14130)

Motivation:
Hostname validation is an important step for clients, in verifying the
identity of the server.

We should make it easy to configure.

Due to its importance, we should also enable it by default. While there
are theoretically multiple algorithms to choose from for this purpose,
the "HTTPS" algorithm is *by far* the most commonly used one.

Modification:
- Add a SslContextBuilder.endpointIdentificationAlgorithm() method to
configure hostname validation.
- Set the endpoint validation algorithm to "HTTPS" by default, when
creating SslContextBuilders for clients.

Result:
Hostname validation is now enabled by default for clients, and can
easily be configured through the SslContext.

Co-authored-by: Chris Vest <[email protected]>
@idelpivnitskiy @normanmaurer
Null value doesn't disable endpoint verification for JDK provider (ne…
d9f3860
…tty#14142)

Motivation:

If Java ever changes the default endpoint identification algorithm of if
users use a 3-party provider that overrides the default, Netty users
won't be able to change it via `SslContextBuilder` API by providing a
null value. Only an empty string will disable it, but this behavior is
not documented in `endpointIdentificationAlgorithm(String)` javadoc.

Modifications:
- Set `endpointIdentificationAlgorithm` unconditionally in
`JdkSslContext`, similar to `ReferenceCountedOpenSslServerContext`.

Result:

`SslContextBuilder.endpointIdentificationAlgorithm(null)` works as
expected with `SslProvider.JDK`.
@hyperxpro @normanmaurer
Add check for IPv6 brackets when address is unresolved (netty#14141)
793f50e
Motivation:
If IPv6 is unresolved, we add double `[]` to it which leads to a
malformed IPv6 address.

Modification:
If unresolved IPv6 already has double brackets `[]` to it then return as
it is else add `[]`.

Result:
Fixes netty#14137

---------

Co-authored-by: Norman Maurer <[email protected]>
@normanmaurer
Update java versions to latest release (netty#14143)
659b69c
Motivation:

The used java versions in our docker-compose file were outdated

Modifications:

Update all versions to latest release

Result:

Use latest versions on CI
@idelpivnitskiy @normanmaurer
JdkSslContext doesn't set endpoint verification algorithm (netty#14144)
8bd36c0
Motivation:

If users configure ALPN, `JdkSslContext.configureAndWrapEngine` skips
endpointIdentificationAlgorithm configuration at all. Otherwise, it only
sets it in a new `SSLParameters` object but does not apply parameters
changes back to the engine. As a result, engine always returns a new
`SSLParameters` object without seeing a change in
`endpointIdentificationAlgorithm`.

Modifications:
- Add `configureEndpointVerification(SSLEngine)` method that properly
sets identification algorithm and applies the change for `SSLEngine`.
- Move this logic before
`JdkApplicationProtocolNegotiator.AllocatorAwareSslEngineWrapperFactory`
check.
- Add `endpointIdentificationAlgorithm(null)` for tests where necessary.

Result:

Endpoint identification algorithm is correctly set for
`SslProvider.JDK`.
@normanmaurer
Replace usage of mirrorlist with baseurl (netty#14156)
4acbe7b
Motivation:

We can't use the default mirrorlist anymore as it will fail and so fail
the docker build

Modifications:

Use baseurl with the correct vault

Result:

Docker image can be build again
@sehaas Sebastian Haas @normanmaurer
fix ResolvConf initialization with SecurityManager enabled (netty#14154)
32378ff
Motivation:

JNDI fallback in `DefaultDnsServerAddressStreamProvider` will not work,
if SecurityManager blocks access to `/etc/resolv.conf`. Handle Exception
for correct `ResolvConf` initialization.

The ResolvConf lookup was added in
netty#13884 and the fallback added in
netty#13951

Modification:

Catch a SecurityException and keep the `resolvConf` null.

Result:

Initialization will work with restrictive SecurityManager config.

Co-authored-by: Sebastian Haas <[email protected]>
@qnnn @normanmaurer
Correct use cache for search domains as well (netty#14171)
d40e183
Motivation:

 In the ResolveWithDotSearchDomain scenario, DNSCache is not being hit.

Modification:

In the ResolveWithDotSearchDomain scenario, attempt to include the
SearchDomain in the cache query.

Modify unit test: testResolveACachedWithDotSearchDomain

Fixes netty#14046.

---------

Co-authored-by: Norman Maurer <[email protected]>
@hyperxpro @normanmaurer
Send Http2PriorityFrame through fireUserEventTriggered for `Http2…
61834eb
…MultiplexHandler` (netty#14168)

Motivation:

`Http2PriorityFrame` is used to indicate that a stream should be
prioritized over others. `Http2MultiplexHandler` can have child channels
like `Http2StreamFrameToHttpObjectCodec` which expects `HttpObject` and
`Http2PriorityFrame` might be something they should be expecting via
`channelRead(...)`. Although this totally depends on the implementation
of `Http2StreamFrameToHttpObjectCodec`, it's best to send them through
`fireUserEventTriggered` which can be safely ignored if the
implementation is not expecting such frames.

Modification:
`Http2PriorityFrame` is now being sent to child channels through
`fireUserEventTriggered` instead of `channelRead`.

Result:
Handling of `Http2PriorityFrame` aligns with `Http2ResetFrame` in
`Http2MultiplexHandler`

---------

Co-authored-by: Norman Maurer <[email protected]>
@qnnn @normanmaurer @bryce-anderson
Fix potential DNS cache invalidation across different EventLoops (net…
3b1fa58
…ty#14147)

Motivation:

By default, `DnsAddressResolverGroup` sets up a separate `DNSCache`
for each `EventLoop`. This can lead to cache invalidation when
performing DNS resolution across different EventLoops due to the
potential absence of cached DNS records.

Modification:

- initializing the DNSCache in `DnsNameResolverBuilder` during
`DnsAddressResolverGroup` initialization to enable sharing of DNSCache
among EventLoops under the same `DnsAddressResolverGroup`.
- Add unit test: testSharedDNSCacheAcrossEventLoops

Result:

Fixes netty#14046.

---------

Co-authored-by: Norman Maurer <[email protected]>
Co-authored-by: Bryce Anderson <[email protected]>
@normanmaurer @bryce-anderson
Reject http header values with non SP / HTAB chars (netty#14178)
5b2a2b3
Motivation:

We should not allow any other whitespace chars then SP / HTAB

Modifications:

- Reject other values
- Add unit test to proof validation works as expected

Result:

Fixes netty#14167

---------

Co-authored-by: Bryce Anderson <[email protected]>
normanmaurer and others added 28 commits June 20, 2025 09:15
@normanmaurer
Testsuite: Ensure counter is updated before write happens so lastIdx … (
f21bc63
netty#15374)

…is always correct

Motivation:

We should increment the counter (which is used for the lastIdx) before
we trigger another operation on the Channel. This is needed as any
operation might result in having `fireChannelRead(...)` called at the
end and so we could end up re-entrance into the `channelRead` method and
then use the wrong value for the lastIdx.

Modifications:

Move counter update before channel.write(...)

Result:

More robust tests
@normanmaurer
Update to maven-3.9.10 (netty#15383)
c1a1ae9
Motivation:

Update to latest maven release

Modifications:

Update maven version

Result:

Use latest maven version
@chrisvest @normanmaurer
Include the "noexec" message in the UnsatisfiedLinkError chain (netty…
ac955ac
…#15415)

Motivation:
A somewhat common cause of our native libraries failing to load is that
`/tmp` is mounted with the "noexec" option.

We already log a message about this when we detect this is a likely
cause for native libraries failing to load. However, modern deployments
now typically funnel all log messages to systems like Splunk, and people
only look at the specific log line that has the exception, filtering out
other presumed irrelevant log messages nearby.

Modification:
Include the "noexec" error message in the exception chain, as well as
logging it.

Result:
Make it easier for people to diagnose when native libraries cannot be
loaded due to a volume being "noexec.
@doom369 @normanmaurer
Avoid expensive native calls in ReferenceCountedOpenSslEngine.rejectR…
8893376
…emoteInitiatedRenegotiation for TLSv1.3 (netty#15440)

Motivation:

While profiling, we found a few strange places in the SSLHandler logic,
specifically `SSL.getHandshakeCount` calls:

![image](https://github.com/user-attachments/assets/3a27de6b-8dea-4679-a07c-c099e4b60d7f)

So, first of all, it seems like this method is called too much,
secondly, in the current implementation, we can avoid this call for
tlsv1.3.

Modification:

Regroup logical checks to delay `getHandshakeCount` calls. This change
fully eliminates `getHandshakeCount` calls for TLSv1.3 and make code
easier to read.

Result:

No more `getHandshakeCount` calls for TLSv1.3
@doom369 @normanmaurer
improve readability of ReferenceCountedOpenSslEngine.setEnabledProtoc…
9f9c575
…ols0 method (netty#15443)

Motivation:

ReferenceCountedOpenSslEngine.setEnabledProtocols0 code hard to read, so
let's improve it.

Modification:

Multiple ifs replaced with switch

Result:

Easier to read
@chrisvest
Upgrade Netty 5 Windows builds to Windows 2022 (netty#15456)
6fc430d
Motivation:
The Windows 2019 they're currently using is deprecated and scheduled to
be removed from GitHub Actions.

Modification:
Use Windows 2022 runners instead.
Also incorporate some build cancellation triggers that we did in 4.2.

Result:
Future proof Windows build.
@chrisvest @skmcgrail
Port over AWS-LC changes to main (netty#15455)
8d19c50
PRs netty#15430 and
netty#15451

---------

Co-authored-by: Sean McGrail <[email protected]>
@derklaro @chrisvest
Add malloc/free based allocator for MemSegBuffer (netty#15387)
f265f09
Motivation:
It is cheap enough to allocate native memory through shared memory
segments. However, freeing shared segments incur a high overhead because
it involves thread-local handshakes with all threads, and JIT
de-optimization. Netty should already reliably handle the native memory
lifecycle, so these pessimistic cautions are not necessary. We can avoid
them by directly calling out to malloc and free, though only if the
memseg-buffer module is given native access permissions.

Modification:
Add a DirectSegmentAllocator interface with 2 implementations: one that
uses the jdk arena api (fallback) to allocate and free memory segments
and one that uses the linker api to resolve the native symbols of
`malloc` and `free`, which are then called directly to allocate and free
segmets. The linker-based implementation is only used if the memseg
buffer module has native access permissions and
`io.netty5.memseg.noMalloc` is not set to `true`.

Result:
Memory segments can now be allocated either by using the jdk arena api
or directly by invoking `malloc` and `free`.

---------

Co-authored-by: Chris Vest <[email protected]>
@chrisvest
Move the MemorySegment based Buffer implementation into the netty-buf…
83bc328
…fer module (netty#15481)

Motivation:
As our version baseline is Java 22, we don't need to have this
implementation stowed away in a separate module. When Java 25 is
released, we can also consider bumping our baseline and removing the
ByteBuffer and Unsafe implementations.

Modification:
Move the netty-buffer-memory-segment files to other modules;
- the buffer implementation moves into the netty-buffer module
- the micro-benchmarks move to the netty-microbench module

Result:
Better code organization.
@normanmaurer
Epoll: Correctly handle UDP packets with source port of 0. (netty#15528)
4f7f461
Motivation:

UDP / Datagram allows a source port of 0, so we should allow it. NIO
already handles it correctly.

Modifications:

Use -1 to signal if we did have a source port or not.

Result:

Consistent behaviour between Epoll and Nio transport. Fixes
netty#15526
@d-william @normanmaurer
Do no check length parameter of ByteBufOutputStream.write(byte[], int…
13357ac
…, int); method (netty#15527)

Motivation:

ByteBufOutputStream#write(byte[], int, int); method should respect the
contract of the DataOutput interface and of the OutputStream class. In
particular, throwing an IndexOutOfBoundsException if offset is negative.
See
[DataOutput](https://docs.oracle.com/en/java/javase/21/docs//api/java.base/java/io/DataOutput.html#write(byte%5B%5D,int,int))
and
[OutputStream](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/io/OutputStream.html#write(byte%5B%5D,int,int)).
This doesn't happen when the given length is 0. In this case, the method
just return.

Modifications:

Removing the check of length parameter preventing enter in
buffer.writeBytes(b, off, len);
Add a test, checking the method throws an IndexOutOfBoundsException when
offset is negative even if the length parameter is 0.

Result:

The ByteBufOutputStream#write(byte[], int, int); method will throw an
IndexOutOfBoundsException when offset is negative even if the length
parameter is 0.
@brucelwl
Make construction method of Http2ServerUpgradeCodec to be public (net…
aa4e387
…ty#15484)

Motivation:
The last construction method of Http2ServerUpgradeCodec should also be set to public

Modifications:

- Change constructor to public

Result:
Fixes  netty#15483
@normanmaurer
Remove usage of io.netty.build.junit.TimedOutTestsListener (netty#15550)
9d57d00
Motivation:

io.netty.build.junit.TimedOutTestsListener does not exists in latest
release of netty-build.

Modifications:

Remove usage of io.netty.build.junit.TimedOutTestsListener

Result:

Fix classloader issues during build
@normanmaurer
Merge commit from fork
1b1543a
* Enforce the maximum number of RST frames that can be sent in window of time

Motivation:

A remote peer might be able to trigger an instance to generate and send RST frames by sending invalid frames on an existing stream. This can cause high resource usage and so might be abused by a remote peer.

Modifications:

Limit the number of RSTs that we allow to be generated and so send in a specific time window. If this limit is reached a GO_AWAY frame is send and the connection be closed.

Result:

Fix high resource usage that can be caused by a remote peer by trigger RST frames

* Adjust testing

* Address comments
@isaacrivriv @normanmaurer
Exposed encoderEnforceMaxRstFramesPerWindow for HttpToHttp2Connection…
86262dd
…HandlerBuilder (netty#15561)

### Motivation:
To expose APIs under AbstractHttp2ConnectionHandlerBuilder to be able to
use with the HttpToHttp2ConnectionHandlerBuilder

### Modification:
Exposed encoderEnforceMaxRstFramesPerWindow under
HttpToHttp2ConnectionHandlerBuilder, updated enforceNonCodecConstraints
for AbstractHttp2ConnectionHandlerBuilder, and updated pom.xml for
ignoring API change


### Result:
Fixes netty#15559
@normanmaurer
HTTP2: Replace System.nanoTime() with Ticker usage to be able to make… (
8d6e6ef
netty#15567)

… tests more stable

Motivation:

We previously used System.nanoTime() in the implementation and then
Thread.sleep(...) in the test. This is not really robust as a lot of
things really depend on how fast things are executed. We can do better
by just use Ticker.

Modifications:

- Inject a MockTicker into the encoder and use it
- Advance the time in the test manually

Result:

More stable test
@chrisvest
Fix BufferStream exception consistency (netty#15573)
875e081
Motivation:
BufferStream did not behave consistently wrt. exceptions thrown from
write(byte[], int, int). This broke in the
netty@13357ac
forward merge.

Modification:
Add thorough testing and fix the exception throwing.

Result:
BufferStream now behaves consistently again across all buffer types.
@chrisvest @normanmaurer
Always load BouncyCastle classes with the Netty classloader (netty#15533
cb84882
) (netty#15569) (netty#15572)

Motivation:
Between Java security settings, different classloaders, and native image
compilation, loading the BouncyCastle classes are somewhat complicated.

Modification:
Collect all the BouncyCastle class loading and availability checking in
a new BouncyCastleUtil class. Make use of this new class in our
BouncyCastle implementations of ALPN, PEM reading, and self-signed
certificate generation.

Result:
We should hopefully now be loading the classes correctly in all cases.

Fixes netty#15508

Co-authored-by: Norman Maurer <[email protected]>
@chrisvest @normanmaurer
Make DatagramMulticastTest handlers sharable (netty#15579)
adb7321
Motivation:
The test has a retry loop, so the handlers need to be sharable.

Modification:
Make the two handlers used in the test sharable.

Result:
The test should no longer fail with exceptions like the following:

```
2025-08-20T21:27:15.4437273Z [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.004 s <<< FAILURE! -- in io.netty.testsuite.transport.socket.DatagramMulticastTest
2025-08-20T21:27:15.4438772Z [ERROR] io.netty.testsuite.transport.socket.DatagramMulticastTest.testMulticast(TestInfo) -- Time elapsed: 0.004 s <<< ERROR!
2025-08-20T21:27:15.4440833Z io.netty.channel.ChannelPipelineException: io.netty.testsuite.transport.socket.DatagramMulticastTest$2 is not a @sharable handler, so can't be added or removed multiple times.
2025-08-20T21:27:15.4442483Z 	at io.netty.channel.DefaultChannelPipeline.checkMultiplicity(DefaultChannelPipeline.java:549)
2025-08-20T21:27:15.4443649Z 	at io.netty.channel.DefaultChannelPipeline.internalAdd(DefaultChannelPipeline.java:166)
2025-08-20T21:27:15.4444995Z 	at io.netty.channel.DefaultChannelPipeline.addLast(DefaultChannelPipeline.java:227)
2025-08-20T21:27:15.4446024Z 	at io.netty.channel.DefaultChannelPipeline.addLast(DefaultChannelPipeline.java:330)
2025-08-20T21:27:15.4447045Z 	at io.netty.channel.DefaultChannelPipeline.addLast(DefaultChannelPipeline.java:319)
2025-08-20T21:27:15.4447883Z 	at io.netty.bootstrap.Bootstrap.init(Bootstrap.java:276)
2025-08-20T21:27:15.4448695Z 	at io.netty.bootstrap.AbstractBootstrap.initAndRegister(AbstractBootstrap.java:327)
2025-08-20T21:27:15.4449842Z 	at io.netty.bootstrap.AbstractBootstrap.doBind(AbstractBootstrap.java:288)
2025-08-20T21:27:15.4450714Z 	at io.netty.bootstrap.AbstractBootstrap.bind(AbstractBootstrap.java:284)
2025-08-20T21:27:15.4451792Z 	at io.netty.testsuite.transport.socket.DatagramMulticastTest.testMulticast(DatagramMulticastTest.java:93)
2025-08-20T21:27:15.4453100Z 	at io.netty.testsuite.transport.socket.DatagramMulticastTest$1.run(DatagramMulticastTest.java:58)
2025-08-20T21:27:15.4454240Z 	at io.netty.testsuite.transport.socket.DatagramMulticastTest$1.run(DatagramMulticastTest.java:55)
2025-08-20T21:27:15.4455378Z 	at io.netty.testsuite.transport.AbstractComboTestsuiteTest.run(AbstractComboTestsuiteTest.java:52)
2025-08-20T21:27:15.4456615Z 	at io.netty.testsuite.transport.socket.DatagramMulticastTest.testMulticast(DatagramMulticastTest.java:55)
2025-08-20T21:27:15.4457594Z 	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
2025-08-20T21:27:15.4458245Z 	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
2025-08-20T21:27:15.4459103Z 	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
2025-08-20T21:27:15.4459917Z 	Suppressed: java.util.concurrent.CompletionException: Rethrowing promise failure cause
2025-08-20T21:27:15.4460952Z 		at io.netty.util.concurrent.DefaultPromise.rethrowIfFailed(DefaultPromise.java:685)
2025-08-20T21:27:15.4461893Z 		at io.netty.util.concurrent.DefaultPromise.sync(DefaultPromise.java:419)
2025-08-20T21:27:15.4462736Z 		at io.netty.channel.DefaultChannelPromise.sync(DefaultChannelPromise.java:119)
2025-08-20T21:27:15.4463601Z 		at io.netty.channel.DefaultChannelPromise.sync(DefaultChannelPromise.java:30)
2025-08-20T21:27:15.4464208Z 		... 8 more
```
@normanmaurer
Update to latest netty-tcnative release (netty#15587)
f0c3368
Motivation:

We released 2.0.73.Final, its time to upgrade

Modifications:

Upgrade to latest tcnative release

Result:

Use latest tcnative release
@normanmaurer @yawkat
Drop unknown frame on missing stream (netty#15592) (netty#15595)
fd0dbe7
Motivation:

Receiving an unknown frame on a stream that is in 'idle' state (i.e. not
created) would produce a NullPointerException.

Modification:

If an unknown frame is received and there is no associated stream, drop
that frame. This is in accordance with [RFC
9113](https://httpwg.org/specs/rfc9113.html#StreamStates):

> Receipt of frames for which the semantics are unknown cannot be
treated as an error, as the conditions for sending and receiving those
frames are also unknown

Another option would be to create the stream.

Result:

No NPE.

Found by fuzzing.

Co-authored-by: Jonas Konrad <[email protected]>
@normanmaurer
HTTP: Allow to configure HttpServerUpgradeHandler to remove itself af… (
6c3e1c1
netty#15594)

…ter the first request on a connection

Motivation:

While it is not strictly required that the first request must be the
upgrade request it is usually what is the case in real world and it is
even required by some protocols. We should allow to configure the
HttpServerUpgradeHandler to remove itself and so reduce overhead.

Modifications:

- Add new constructor which allows to specify that we remove the handler
after the first request even if its not an upgrade
- Adjust unit test

Result:

Fixes netty#15489
@normanmaurer
Update to latest maven release (netty#15607)
60d1564
Motivation:

We should use the latest maven release for building

Modifications:

Update maven version

Result:

Use latest maven release
@yawkat @normanmaurer
Make ResourceLeakDetector.track not final (netty#15620)
125425a
Motivation:

For fuzzing, paranoid leak detection is necessary, but running GC for
each test is too slow. Instead, I check the `allLeaks` field after each
run for any open trackers (with some pruning to avoid static buffers).
This means that a lot of the tracked data, and in particular the whole
reference queue, is unnecessary.

For better performance, it would be nice to instead only track the
number of open leaks, and compare that number before and after a test
runs. This can be achieved using a custom ResourceLeakTracker
implementation, but for that ResourceLeakDetector.track must become
non-final.

Modification:

Make the method non-final.

Also fix a bunch of warnings.

Result:

ResourceLeakDetector.track can be overridden for more efficient leak
detection.

---------

Co-authored-by: Norman Maurer <[email protected]>
@derklaro
drop a bunch of unnessacary reflection (netty#15636)
de80681
Motivation:
With the bump of the main branch to java 22 a bunch of reflection and
java version guards are no longer needed as the relevant methods can be
used directly.

Modification:
Remove the relevant reflection calls java version guards.

Result:
No more unnessacary reflection and java version guards that just make
the code harder to read.
@derklaro
update/cleanup codeql workflow (netty#15683)
bcdaf60
Motivation:
As stated when executing the workflow, the major version (v2) of codeql
that is currently in use has long been deprecated. This PR updates the
codeql actions to v3 and also includes bumping the other action version
majors (major bump due to a new major nodejs requirement, not relevant
on github-hosted runners) as well as a bit of cleanup to the action.

Modification:
Updates the codeql actions to v3, updates actions/checkout and
action/setup-java to v5 (codeql action only), cleanup of codeql workflow
definition.

Result:
The latest codeql version is in use and the workflow definition is
cleaned up.
@normanmaurer
Update jni-util version to clarify licensing (netty#15687) (netty#15690)
8997433
Motivation:

A new jni-util version was released which replaced some code which had
no clear licensing.

Modifications:

Upgrade to latest version

Result:

Clear licensing of jni-util dependency
@jmcrawford45
Introduce SslCredential API
79ffcb2
@jmcrawford45
jmcrawford45 changed the base branch from 5.0 to 4.2 November 20, 2025 16:01
@jmcrawford45 jmcrawford45 closed this Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

20 participants

@jmcrawford45 @chrisvest @yawkat @normanmaurer @hezhangjian @franz1981 @thxwelchs @croister @idelpivnitskiy @hyperxpro @sehaas @qnnn @slandelle @Munoon @vietj @dao-jun @CLFutureX @isaacrivriv @freeyob @jiangyunpeng
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.