Skip to content

Bump org.apache.sshd:sshd-core from 0.8.0 to 2.13.2 - #819

Merged
slachiewicz merged 2 commits into
apache:wagon-3.xfrom
slachiewicz:copilot/bump-sshd-core-version
Oct 20, 2025
Merged

slachiewicz merged 2 commits into
apache:wagon-3.xfrom
slachiewicz:copilot/bump-sshd-core-version

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Overview

This PR upgrades Apache SSHD from version 0.8.0 (released in 2012) to 2.13.2 (latest stable in the 2.x series) to address API incompatibilities and leverage modern, well-maintained SSH server implementation for testing.

Changes

Dependency Updates

Updated wagon-providers/wagon-ssh-common-test/pom.xml:

  • sshd-core: 0.8.0 → 2.13.2
  • Added sshd-scp: 2.13.2 (SCP support split into separate module)
  • Added sshd-sftp: 2.13.2 (SFTP support split into separate module)

Code Migrations

SshServerEmbedded.java - Updated to use SSHD 2.x API:

  • Replaced deprecated PEMGeneratorHostKeyProvider with SimpleGeneratorHostKeyProvider
  • Switched to built-in ScpCommandFactory from org.apache.sshd.scp.server
  • Simplified to use standard NativeFileSystemFactory instead of custom implementation
  • Updated stop() method signature to throw IOException per SSHD 2.x API

TestPublickeyAuthenticator.java:

  • Migrated from Apache Mina's org.apache.mina.util.Base64 to Java's built-in java.util.Base64
  • Updated imports to match SSHD 2.x package structure (org.apache.sshd.server.auth.pubkey)

TestPasswordAuthenticator.java:

  • Updated imports to match SSHD 2.x package structure (org.apache.sshd.server.auth.password)

ShellCommand.java:

  • Updated Command interface implementation to accept ChannelSession parameter in start() and destroy() methods as required by SSHD 2.x

Removed Obsolete Code

Deleted custom implementations that are now provided by SSHD 2.x:

  • ScpCommand.java (458 lines) - Replaced by SSHD 2.x built-in SCP implementation
  • ScpCommandFactory.java (93 lines) - Replaced by org.apache.sshd.scp.server.ScpCommandFactory

Impact

This is a net reduction of 604 lines while upgrading to a modern, actively maintained version of Apache SSHD. The upgrade improves security, reliability, and maintainability of the SSH test infrastructure.

@slachiewicz slachiewicz added dependencies Pull requests that update a dependency file mvn3 labels Oct 19, 2025
Copilot AI and others added 2 commits October 19, 2025 18:31
Co-authored-by: slachiewicz <6705942+slachiewicz@users.noreply.github.com>

Upgrade sshd-core dependency from 0.8.0 to 2.13.2
Co-authored-by: slachiewicz <6705942+slachiewicz@users.noreply.github.com>
@slachiewicz
slachiewicz force-pushed the copilot/bump-sshd-core-version branch from a1e4bd9 to 0d0764e Compare October 19, 2025 16:33
@slachiewicz
slachiewicz merged commit a0b40b2 into apache:wagon-3.x Oct 20, 2025
4 of 20 checks passed
@github-actions github-actions Bot added this to the 3.5.4 milestone Oct 20, 2025
@slachiewicz
slachiewicz deleted the copilot/bump-sshd-core-version branch December 29, 2025 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file mvn3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants