Skip to content

bouncycastle troubles again with ssh and 4.42 platform #302

Description

@iloveeclipse

Version

7.9.0.202609171238

Operating System

Linux/Unix

Bug description

Saw this with last stable nightly SDK build & jgit 7.9.0.202609171238

We have a version mix of bouncycastle bundles in SDK & Jgit, leading to errors trying access git repositories via ssh

Image
eclipse.buildId=4.42.0.I20260920-2300
java.version=25
java.vendor=Eclipse Adoptium
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments:  -os linux -ws gtk -arch x86_64

org.eclipse.egit.core
Error
Tue Sep 22 07:45:10 CEST 2026
ssh://git@some.company.com:7999/ec/eclipse_jdt_junit_runners.git: DefaultConnectFuture[git@some.company.com/10.206.118.55:7999]: Failed (ClassCastException) to execute: class org.bouncycastle.jcajce.provider.asymmetric.edec.BC15EdDSAPublicKey cannot be cast to class org.bouncycastle.jcajce.interfaces.EdDSAPublicKey (org.bouncycastle.jcajce.provider.asymmetric.edec.BC15EdDSAPublicKey is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @31321325; org.bouncycastle.jcajce.interfaces.EdDSAPublicKey is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @4705be00)

org.eclipse.jgit.api.errors.TransportException: ssh://git@some.company.com:7999/ec/eclipse_jdt_junit_runners.git: DefaultConnectFuture[git@some.company.com/10.206.118.55:7999]: Failed (ClassCastException) to execute: class org.bouncycastle.jcajce.provider.asymmetric.edec.BC15EdDSAPublicKey cannot be cast to class org.bouncycastle.jcajce.interfaces.EdDSAPublicKey (org.bouncycastle.jcajce.provider.asymmetric.edec.BC15EdDSAPublicKey is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @31321325; org.bouncycastle.jcajce.interfaces.EdDSAPublicKey is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @4705be00)
	at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:249)
	at org.eclipse.jgit.api.PullCommand.call(PullCommand.java:273)
	at org.eclipse.egit.core.op.PullOperation$PullJob.run(PullOperation.java:256)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: org.eclipse.jgit.errors.TransportException: ssh://git@some.company.com:7999/ec/eclipse_jdt_junit_runners.git: DefaultConnectFuture[git@some.company.com/10.206.118.55:7999]: Failed (ClassCastException) to execute: class org.bouncycastle.jcajce.provider.asymmetric.edec.BC15EdDSAPublicKey cannot be cast to class org.bouncycastle.jcajce.interfaces.EdDSAPublicKey (org.bouncycastle.jcajce.provider.asymmetric.edec.BC15EdDSAPublicKey is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @31321325; org.bouncycastle.jcajce.interfaces.EdDSAPublicKey is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @4705be00)
	at org.eclipse.jgit.transport.sshd.SshdSessionFactory.getSession(SshdSessionFactory.java:267)
	at org.eclipse.jgit.transport.sshd.SshdSessionFactory.getSession(SshdSessionFactory.java:1)
	at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:107)
	at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:285)
	at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:152)
	at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:165)
	at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:105)
	at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1459)
	at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:238)
	... 3 more
Caused by: org.apache.sshd.common.SshException: DefaultConnectFuture[git@some.company.com/10.206.118.55:7999]: Failed (ClassCastException) to execute: class org.bouncycastle.jcajce.provider.asymmetric.edec.BC15EdDSAPublicKey cannot be cast to class org.bouncycastle.jcajce.interfaces.EdDSAPublicKey (org.bouncycastle.jcajce.provider.asymmetric.edec.BC15EdDSAPublicKey is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @31321325; org.bouncycastle.jcajce.interfaces.EdDSAPublicKey is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @4705be00)
	at org.apache.sshd.common.future.AbstractSshFuture.lambda$verifyResult$2(AbstractSshFuture.java:146)
	at org.apache.sshd.common.future.AbstractSshFuture.formatExceptionMessage(AbstractSshFuture.java:206)
	at org.apache.sshd.common.future.AbstractSshFuture.verifyResult(AbstractSshFuture.java:145)
	at org.apache.sshd.client.future.DefaultConnectFuture.verify(DefaultConnectFuture.java:55)
	at org.apache.sshd.client.future.DefaultConnectFuture.verify(DefaultConnectFuture.java:36)
	at org.apache.sshd.common.future.VerifiableFuture.verify(VerifiableFuture.java:121)
	at org.eclipse.jgit.transport.sshd.SshdSession.connect(SshdSession.java:215)
	at org.eclipse.jgit.transport.sshd.SshdSession.connect(SshdSession.java:146)
	at org.eclipse.jgit.transport.sshd.SshdSession.connect(SshdSession.java:100)
	at org.eclipse.jgit.transport.sshd.SshdSessionFactory.getSession(SshdSessionFactory.java:260)
	... 11 more
Caused by: java.lang.ClassCastException: class org.bouncycastle.jcajce.provider.asymmetric.edec.BC15EdDSAPublicKey cannot be cast to class org.bouncycastle.jcajce.interfaces.EdDSAPublicKey (org.bouncycastle.jcajce.provider.asymmetric.edec.BC15EdDSAPublicKey is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @31321325; org.bouncycastle.jcajce.interfaces.EdDSAPublicKey is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @4705be00)
	at org.apache.sshd.common.util.security.eddsa.bouncycastle.BouncyCastleEdDSASupport.generateEDDSAPublicKey(BouncyCastleEdDSASupport.java:114)
	at org.apache.sshd.common.util.security.eddsa.bouncycastle.BouncyCastleEdDSASupport.generateEDDSAPublicKey(BouncyCastleEdDSASupport.java:48)
	at org.apache.sshd.common.util.security.eddsa.generic.GenericEd25519PublicKeyDecoder.decodePublicKey(GenericEd25519PublicKeyDecoder.java:95)
	at org.apache.sshd.common.config.keys.PublicKeyEntryDecoder.decodePublicKeyByType(PublicKeyEntryDecoder.java:76)
	at org.apache.sshd.common.config.keys.PublicKeyRawDataDecoder.decodePublicKey(PublicKeyRawDataDecoder.java:62)
	at org.apache.sshd.common.config.keys.PublicKeyRawDataDecoder.decodePublicKey(PublicKeyRawDataDecoder.java:51)
	at org.apache.sshd.common.config.keys.PublicKeyEntryDecoder.resolve(PublicKeyEntryDecoder.java:55)
	at org.apache.sshd.common.config.keys.PublicKeyEntry.resolvePublicKey(PublicKeyEntry.java:154)
	at org.apache.sshd.common.config.keys.AuthorizedKeyEntry.resolvePublicKey(AuthorizedKeyEntry.java:109)
	at org.eclipse.jgit.internal.transport.sshd.OpenSshServerKeyDatabase$HostKeyFile.reload(OpenSshServerKeyDatabase.java:716)
	at org.eclipse.jgit.internal.transport.sshd.OpenSshServerKeyDatabase$HostKeyFile.get(OpenSshServerKeyDatabase.java:691)
	at org.eclipse.jgit.internal.transport.sshd.OpenSshServerKeyDatabase.lookup(OpenSshServerKeyDatabase.java:187)
	at org.eclipse.jgit.internal.transport.sshd.JGitServerKeyVerifier.lookup(JGitServerKeyVerifier.java:72)
	at org.eclipse.jgit.internal.transport.sshd.JGitClientSession.resolveAvailableSignaturesProposal(JGitClientSession.java:282)
	at org.apache.sshd.common.session.helpers.SessionHelper.resolveAvailableSignaturesProposal(SessionHelper.java:959)
	at org.apache.sshd.common.session.helpers.SessionHelper.getKexProposal(SessionHelper.java:984)
	at org.apache.sshd.common.session.helpers.AbstractSession.sendKexInit(AbstractSession.java:2733)
	at org.eclipse.jgit.internal.transport.sshd.JGitClientSession.sendKexInit(JGitClientSession.java:208)
	at org.apache.sshd.client.session.AbstractClientSession.initializeKeyExchangePhase(AbstractClientSession.java:318)
	at org.apache.sshd.client.session.ClientSessionImpl.start(ClientSessionImpl.java:98)
	at org.apache.sshd.common.session.helpers.AbstractSessionIoHandler.sessionCreated(AbstractSessionIoHandler.java:52)
	at org.apache.sshd.common.io.nio2.Nio2Connector$ConnectionCompletionHandler.onCompleted(Nio2Connector.java:216)
	at org.apache.sshd.common.io.nio2.Nio2Connector$ConnectionCompletionHandler.onCompleted(Nio2Connector.java:182)
	at org.apache.sshd.common.io.nio2.Nio2Connector.lambda$connect$1(Nio2Connector.java:111)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:545)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:328)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
	at java.base/java.lang.Thread.run(Thread.java:1474)

Actual behavior

Unable to fetch via ssh

Expected behavior

ssh connection works

Relevant log output

Other information

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions