ffang commented on PR #3782: URL: https://github.com/apache/cxf/pull/3782#issuecomment-7176917381
> Thanks, the centralized `applyNamedGroups` and the cached reflection look good. A few points: > > 1. **Netty HTTP/2 client:** it uses `SslContext.defaultClientProvider()`, which picks OpenSSL when netty-tcnative is present. Netty's OpenSSL engine ignores `SSLParameters` named groups, so the restriction is silently not enforced. Could we force `SslProvider.JDK` when namedGroups are set (as the server already does), or at least warn? > 2. **`applyNamedGroupsBC` (SSLUtils):** on a reflection failure it logs at FINE and still returns `true`, so the groups are dropped with no warning. Please log at WARNING, or return `false` so it falls back to the `SSLParameters` path. > 3. **Minor:** on a JDK older than 20 without BC, `applyNamedGroups(SSLEngine/SSLSocket)` still reads the parameters and sets them back on every connection, though nothing changes. An early return on `!isNamedGroupsSupported()` would skip that. > 4. **Not from this PR:** BC detection uses `Class.forName` with SSLUtils' own classloader, and the result is now cached. Under OSGi, a separately installed bctls won't be found for the life of the class. Consider also trying the engine's own classloader. Thanks @coheigea. 1. I couldn't reproduce this one: with Netty 4.2.21 and netty-tcnative 2.0.84, `OpenSslEngine` applies the named groups from `SSLParameters`. An OpenSSL client engine restricted to `secp384r1` fails the handshake with a `secp256r1`-only server (`No common named group`), the same as the JDK engine, and succeeds without the restriction. So the HTTP/2 client is covered with either provider. 2. Done in 2447d4a870: a failure through BC JSSE now logs a warning and falls back to `SSLParameters`. 3. Done: before JDK 20 without BC, it warns once and returns without touching the parameters. 4. Done as well: BC JSSE is now recognised through the engine or socket class itself, cached with a `ClassValue`, so a bctls that CXF's class loader can't see is picked up, and no class loader is kept reachable. Checked with BC loaded in a separate class loader on JDK 17 and 21. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
