Skip to content

Conversation

@sratz
Copy link
Contributor

@sratz sratz commented Oct 24, 2025

handleSplash();

try {
new KeyStoreUtil().setUpSslContext(getOS());
Copy link
Member

Choose a reason for hiding this comment

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

Should we not make it just static? If not

Suggested change
new KeyStoreUtil().setUpSslContext(getOS());
new KeyStoreUtil(getOS()).setUpSslContext();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The tests need to subclass, so I'll use the constructor approach.

@merks
Copy link
Contributor

merks commented Oct 24, 2025

Great to see progress on this.

Please include copyright/license headers in the new *.java files.

// the location of the boot plugin we are going to use
handleSplash();

try {
Copy link
Member

Choose a reason for hiding this comment

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

I think one would at least want a system property to disable this behavior without the need to configure an own keystore.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I agree there should be an easy opt-out option.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense. Any proposal for a property name? I see a bunch in org.eclipse.equinox.launcher.Main that just use eclipse. as prefix, so maybe eclipse.load.os.trust.store.by.default

Copy link
Contributor

Choose a reason for hiding this comment

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

I think one would at least want a system property to disable this behavior without the need to configure an own keystore.

So, with the next update, an existing installatioin would silently start trusting more certs? 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

So, with the next update, an existing installatioin would silently start trusting more certs?

I'm not sure I would word things that way. It will find more root certificates. During a past update, it went from finding them only in the JRE to finding them only in the windows root. That change was silent and one hoped it would find more roots that way, but apparent the windows root can be quite empty initially. With this change it will find them in both paces.

If you don't trust the OS's root certificates and/or the JRE's root certificates, you probably should not connect the internet at all.

@github-actions
Copy link

github-actions bot commented Oct 24, 2025

Test Results

  816 files  + 6    816 suites  +6   1h 28m 3s ⏱️ - 5m 35s
2 231 tests + 9  2 182 ✅ + 9   49 💤 ±0  0 ❌ ±0 
6 705 runs  +27  6 555 ✅ +26  150 💤 +1  0 ❌ ±0 

Results for commit b1eeb1b. ± Comparison against base commit add2865.

♻️ This comment has been updated with latest results.

@sratz
Copy link
Contributor Author

sratz commented Oct 24, 2025

Test execution on Windows and Mac now fails with

org.apache.maven.surefire.api.util.SurefireReflectionException: java.util.ServiceConfigurationError: org.junit.platform.engine.TestEngine: org.junit.platform.suite.engine.SuiteTestEngine not a subtype
	at org.apache.maven.surefire.api.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:129)
	at org.apache.maven.surefire.api.util.ReflectionUtils.invokeGetter(ReflectionUtils.java:62)
	at org.apache.maven.surefire.junitplatform.LazyLauncher.launcher(LazyLauncher.java:68)
	at org.apache.maven.surefire.junitplatform.LazyLauncher.discover(LazyLauncher.java:50)
	at org.apache.maven.surefire.junitplatform.TestPlanScannerFilter.accept(TestPlanScannerFilter.java:52)
	at org.apache.maven.surefire.api.util.DefaultScanResult.applyFilter(DefaultScanResult.java:87)
	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.scanClasspath(JUnitPlatformProvider.java:144)
	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:124)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.apache.maven.surefire.api.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:137)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:148)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:88)
	at org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.invokeSureFire(OsgiSurefireBooter.java:195)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.run(OsgiSurefireBooter.java:116)
	at org.eclipse.tycho.surefire.osgibooter.HeadlessTestApplication.start(HeadlessTestApplication.java:29)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:219)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:149)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:115)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:467)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:298)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:623)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:571)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1423)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1395)
Caused by: java.util.ServiceConfigurationError: org.junit.platform.engine.TestEngine: org.junit.platform.suite.engine.SuiteTestEngine not a subtype
	at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:593)
	at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1244)
	at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1273)
	at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1309)
	at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1393)
	at java.base/java.lang.Iterable.forEach(Iterable.java:74)
	at org.junit.platform.launcher.core.LauncherFactory.collectTestEngines(LauncherFactory.java:161)
	at org.junit.platform.launcher.core.LauncherFactory.createDefaultLauncher(LauncherFactory.java:139)
	at org.junit.platform.launcher.core.LauncherFactory.lambda$openSession$1(LauncherFactory.java:102)
	at org.junit.platform.launcher.core.DefaultLauncherSession.lambda$new$0(DefaultLauncherSession.java:66)
	at org.junit.platform.launcher.core.ClasspathAlignmentCheckingLauncherInterceptor.intercept(ClasspathAlignmentCheckingLauncherInterceptor.java:25)
	at org.junit.platform.launcher.core.DefaultLauncherSession.<init>(DefaultLauncherSession.java:66)
	at org.junit.platform.launcher.core.LauncherFactory.openSession(LauncherFactory.java:100)
	at org.junit.platform.launcher.core.LauncherFactory.openSession(LauncherFactory.java:82)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.apache.maven.surefire.api.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:125)
	... 28 more

No idea why.

@sratz
Copy link
Contributor Author

sratz commented Oct 24, 2025

org.eclipse.osgi.internal.loader.EquinoxClassLoader@6622a690[junit-platform-engine:1.14.0(id=215)]
vs.
org.eclipse.osgi.internal.loader.EquinoxClassLoader@5173200b[junit-platform-suite-engine:6.0.0(id=176)]

@merks
Copy link
Contributor

merks commented Oct 24, 2025

There are two of these:

image image

So probably adding this to constrain the latter will help:

image

Or maybe you have to constrain both, which wouldn't hurt. 😢

@sratz
Copy link
Contributor Author

sratz commented Oct 24, 2025

Or maybe you have to constrain both, which wouldn't hurt. 😢

That works, but why is this necessary? Who's to blame here for having a too wide version range?

@merks
Copy link
Contributor

merks commented Oct 24, 2025

The blame seemed to be in multiple places. E.g., the jdt junit 5 runtime had no upper bounds. A great many places had/have no bounds. I've not done an analysis of the junit/jupiter bundle dependencies themselves but one might hope those would prevent this. In any case, I don't fully understand the whole process of how these things are actually loaded, but it's a bit of a nightmare.

And of course no PR is complete without some random infrastructure problems:

Error: Failed to execute goal org.eclipse.tycho:tycho-p2-plugin:5.0.0:p2-metadata-default (default-p2-metadata-default) on project org.eclipse.equinox.server.core: Execution default-p2-metadata-default of goal org.eclipse.tycho:tycho-p2-plugin:5.0.0:p2-metadata-default failed: Error trying to download org.eclipse.equinox.server.core version 1.16.700.v20251022-1724 from https://download.eclipse.org/eclipse/updates/4.38-I-builds/I20251022-1900:
Error: Download of org.eclipse.update.feature,org.eclipse.equinox.server.core,1.16.700.v20251022-1724 failed on repository https://download.eclipse.org/eclipse/updates/4.38-I-builds/I20251022-1900. Retrying. :
Error: download from https://download.eclipse.org/eclipse/updates/4.38-I-builds/I20251022-1900/features/org.eclipse.equinox.server.core_1.16.700.v20251022-1724.jar timed out: request timed out
Error: -> [Help 1]

"KeychainStore" on macOS CI machine is likely empty.
Comment on lines +120 to +121
String p11KeyStore = "PKCS11";
String none = "NONE";
Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 These are effectively constants, better to make them final, at least, or convert to real constants?

equinoxConfig.setFrameworkArgs(frameworkArgs);
equinoxConfig.setAppArgs(appArgs);

try {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the wrong place to put SSL context setup if we want it to be universally available when the framework starts.

Having SSL context management built into the framework is not the proper solution. If it is determined SSL context must be setup and managed very early then it should be placed in a system bundle fragment. That is similar to our fragment org.eclipse.osgi.compatibility.state that the platform ships

ExtensionBundle-Activator: org.eclipse.osgi.compatibility.state.Activator
Fragment-Host: org.eclipse.osgi;bundle-version="3.12.0"

That fragment is specific to Equinox with a host org.eclipse.osgi;bundle-version="3.12.0" but here you don't have any dependencies on Equinox specifically, so you can simply have a Fragment-Host value be system.bundle so it can be attached to any OSGi framework implementation and initialized as early as possible. Then you would specify a ExtensionBundle-Activator with your BundleActivator implementation in the fragment and that can make these calls to initialize the KeyStoreUtil.

With this fragment installed into any OSGi R8 framework implementation then the SSL context management would be initialized as early as possible when the framework implementation initializes. That is regardless of what launcher is being used to initialize and start the framework and that can be done with any framework implementation.

Also, there is no reason such a fragment must exist in Equinox. This could be completely managed by the Platform project itself (which is what I would prefer).

Copy link
Member

Choose a reason for hiding this comment

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

so it can be attached to any OSGi framework implementation and initialized as early as possible
...
Then you would specify a ExtensionBundle-Activator with your BundleActivator implementation in the fragment and that can make these calls to initialize the KeyStoreUtil.

Just as a reference from the R8 spec it is described here https://docs.osgi.org/specification/osgi.core/8.0.0/framework.module.html#framework.module.extensionActivator

Also, there is no reason such a fragment must exist in Equinox. This could be completely managed by the Platform project itself (which is what I would prefer).

I see some benefits having it in Equinox as it is general purpose and not bound to any platform specific APIs.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see some benefits having it in Equinox as it is general purpose and not bound to any platform specific APIs.

Platform can certainly contain general purpose things, all our artifacts get published to maven central with the same group ID, so it makes no difference to the users what sub-project it is maintained at. My point is that Equinox doesn't have to be the place to maintain this and Equinox itself will not make any use of it internally so I would prefer it be placed somewhere else where the maintainers are using it.

Copy link
Member

Choose a reason for hiding this comment

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

Yes I agree this is independent but with that argument we could have an almost empty repository except the org.eclipse.osgi :-)

So even if Equinox per se not is making use of this now it sounds like something useful in the context of OSGi (what is the mission statement of Equinox) and is at the same time also equally independent from platform (what mostly is connected to the RCP 3/4 platform and IDE) but I would simply lean to what works best.

Maybe in exchange we can move some other bundles to the platform instead :-)

Copy link
Contributor

Choose a reason for hiding this comment

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

TBH I don't have that strong of a preference. I just want it somewhere that is easy to maintain by the authors that are going to maintain it.

My overall preference would be to move everything out of Equinox except things directly related to implementing the OSGi standard. That ship has sailed, but I still would rather have non-standard utility type APIs in some other Eclipse project.

Copy link
Member

Choose a reason for hiding this comment

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

My overall preference would be to move everything out of Equinox except things directly related to implementing the OSGi standard.

That sounds reasonable

That ship has sailed

I think it is not hopeless, just create an issue for any particular bundle you like to get rid of an I'll try to take care to move it somewhere else, it will always take some time but we already have moved code for other reasons as well.

@sratz
Copy link
Contributor Author

sratz commented Nov 3, 2025

Moving to org.eclipse.core.runtime.

@sratz sratz closed this Nov 3, 2025
sratz added a commit to eclipse-platform/eclipse.platform that referenced this pull request Nov 11, 2025
Merge JVM and OS trust stores in case opt-in system property

  eclipse.platform.mergeTrust

is set and trust is not otherwise customized via the

  javax.net.ssl.trustStore[...]

system properties.

Resolves:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=567504
#1690

Obsoletes (to-be-reverted):
eclipse-platform/eclipse.platform.releng.aggregator#929
eclipse-packaging/packages#224

Replaces:
eclipse-equinox/equinox#1176

See also:
eclipse-simrel/.github#38
sratz added a commit to eclipse-platform/eclipse.platform that referenced this pull request Nov 11, 2025
Merge JVM and OS trust stores in case opt-in system property

  eclipse.platform.mergeTrust

is set and trust is not otherwise customized via the

  javax.net.ssl.trustStore[...]

system properties.

Resolves:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=567504
#1690

Obsoletes (to-be-reverted):
eclipse-platform/eclipse.platform.releng.aggregator#929
eclipse-packaging/packages#224

Replaces:
eclipse-equinox/equinox#1176

See also:
eclipse-simrel/.github#38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants