Skip to content

Add subsystem channel request support (RFC 4254 §6.5)#98

Merged
kruton merged 2 commits intokruton:mainfrom
GlassOnTin:subsystem-channel
Apr 4, 2026
Merged

Add subsystem channel request support (RFC 4254 §6.5)#98
kruton merged 2 commits intokruton:mainfrom
GlassOnTin:subsystem-channel

Conversation

@GlassOnTin
Copy link
Copy Markdown
Contributor

Summary

Adds requestSubsystem(name: String): Boolean to the SshSession interface and SessionChannel implementation, enabling subsystem invocation (e.g. SFTP) on session channels.

This is a prerequisite for SFTP support (discussed in #96). Follows the same pattern as requestShell().

Changes

  • SshSession.kt — added requestSubsystem(name: String): Boolean to the interface
  • SessionChannel.kt — implementation using ChannelRequestSubsystem protocol message
  • SshClientIntegrationTest.kt — two integration tests:
    • Open SFTP subsystem and verify SSH_FXP_INIT/SSH_FXP_VERSION exchange
    • Verify unknown subsystem is rejected by the server

Test plan

  • ./gradlew :sshlib:test — integration tests pass against OpenSSH testcontainer
  • Verify SFTP subsystem opens and responds with correct version
  • Verify unknown subsystem names are rejected

Add requestSubsystem(name) to SshSession interface and SessionChannel
implementation, enabling subsystem invocation (e.g. SFTP) on session
channels. Follows the same pattern as requestShell().

Integration tests verify:
- SFTP subsystem opens and responds to SSH_FXP_INIT with SSH_FXP_VERSION
- Unknown subsystem names are rejected by the server
@kruton kruton force-pushed the subsystem-channel branch from 9cdc231 to 0cac9f4 Compare April 4, 2026 18:04
@kruton kruton merged commit 43c2eca into kruton:main Apr 4, 2026
6 of 7 checks passed
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.

2 participants