Skip to content

Replace the last deprecated calls: Grizzly SSLContextConfigurator and SecurityManager - #138

Merged
vharseko merged 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:codeql-deprecated-ssl-securitymanager
Oct 2, 2026
Merged

vharseko merged 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:codeql-deprecated-ssl-securitymanager

Conversation

@vharseko

Copy link
Copy Markdown
Member

Closes the remaining java/deprecated-call alerts on real (non-MessagesUtil.*Legacy) code: SSLContextConfigurator.createSSLContext (3) and System.getSecurityManager (1). Together with the 67 MessagesUtil.serializeLegacy/deserializeLegacy alerts (dismissed as "won't fix" — see below) and the reflection/boxing/close alerts fixed in #134, this closes java/deprecated-call entirely.

SSLContextConfigurator.createSSLContext() — 3 sites

Grizzly's SSLContextConfigurator.createSSLContext() is deprecated in favour of createSSLContext(boolean throwException). Checked the Grizzly source: the no-arg version is literally return createSSLContext(false); — identical behaviour, so ConnectionManager.java (×2) and ConnectorServer.java (grizzly, ×1) switch to createSSLContext(false) with no behaviour change.

System.getSecurityManager() — CCLWatchThreadFactory

This class's own comment says it is "Copied from java.util.concurrent.Executors.DefaultThreadFactory". Checked the current JDK's own copy of that class (OpenJDK 26 source): it has since dropped the SecurityManager branch entirely, now unconditionally group = Thread.currentThread().getThreadGroup(); — matching the permanent disabling of the Security Manager in JEP 486. This PR makes the same change here, with a comment explaining why.

MessagesUtil.serializeLegacy / deserializeLegacy — 67 alerts, dismissed, not touched

These are the framework's only serialization path for payloads its own wire protocol defines as opaque bytes rather than structured protobuf messages — scriptArguments (CommonObjectMessages.proto), connectorObject, attributes, and the sync token value (OperationMessages.proto). There is no drop-in non-deprecated alternative without redefining the wire protocol, which would break compatibility with the .NET connector server and existing clients. Dismissed on GitHub as "won't fix" with that reasoning recorded on each alert.

Tests

No new tests: both changes are behaviour-preserving (verified against the Grizzly source and the current JDK source respectively), and neither has an observable difference a test could assert on.

Local runs of the three touched modules, all green: connector-framework-internal 469 tests (2 skipped, same as on master), connector-framework-server 29, connector-server-grizzly 34.

… SecurityManager

createSSLContext() is deprecated in favour of createSSLContext(boolean);
the no-arg version is exactly createSSLContext(false) (verified against
the Grizzly source), so the three call sites switch to that with no
behaviour change.

CCLWatchThreadFactory is its own copy of
java.util.concurrent.Executors.DefaultThreadFactory. The JDK's own copy
dropped the SecurityManager check once the Security Manager was
permanently disabled (JEP 486); this one follows suit.
@vharseko vharseko added java Pull requests that update java code framework OpenICF-java-framework labels Sep 18, 2026
@vharseko vharseko added the refactoring Code cleanup / tech debt, no behavior change label Sep 18, 2026

@maximthomas maximthomas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: The Grizzly swap is exactly equivalent, and the evidence holds across the whole supported range.

  • SSLContextConfigurator.createSSLContext() is return createSSLContext(false); in 3.0.1 source, and aload_0; iconst_0; invokevirtual createSSLContext:(Z) in the 4.0.2 bytecode, so the OSGi import range [3.0,5) changes nothing at ConnectionManager.java:301,305 and ConnectorServer.java:370.
  • The "together with #134" claim checks out: every file on master with an open java/deprecated-call alert is one of these three or in #134's file list.

@vharseko
vharseko merged commit be3ae4a into OpenIdentityPlatform:master Oct 2, 2026
14 checks passed
@vharseko
vharseko deleted the codeql-deprecated-ssl-securitymanager branch October 2, 2026 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

framework OpenICF-java-framework java Pull requests that update java code refactoring Code cleanup / tech debt, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants