Skip to content

WIP: Enable certificate-based authentication for slaves#511

Open
tsautier wants to merge 1 commit intodrftpd-ng:masterfrom
tsautier:feat/issue-138-cert-auth
Open

WIP: Enable certificate-based authentication for slaves#511
tsautier wants to merge 1 commit intodrftpd-ng:masterfrom
tsautier:feat/issue-138-cert-auth

Conversation

@tsautier
Copy link
Copy Markdown

Problem

Currently, Slaves are authenticated solely by their IP address matching a configured hostmask. This is insecure (IP spoofing) and difficult to manage for Slaves with dynamic IP addresses.

Solution

Implement Mutual TLS (mTLS) authentication. The Master can now request a client certificate from the Slave and verify its SHA-256 fingerprint against the Slave's configuration.

Changes Made

  • SlaveManager.java: Added slavemanager.ssl.clientauth property (none, want, need) to control client certificate requests during the TLS handshake.
  • RemoteSlave.java: Added checkCertificate() method to checkConnect(). It calculates the peer certificate's fingerprint and compares it to the fingerprint property in the slave's config.
  • Configuration:
    • Master: slavemanager.ssl.clientauth=want (recommended).
    • Slave Config (Master-side): "fingerprint": "SHA256:..." to enforce validation.

Verification

  • Verified that SlaveManager correctly configures the SSLServerSocket based on the property.
  • Verified that RemoteSlave correctly extracts and hashes the certificate.
  • Verified that connections fall back to IP check (with a log warning) if no fingerprint is configured, allowing for TOFU (Trust On First Use).
  • Confirmed that FXP data connections (PassiveConnection, ActiveConnection) are unaffected and do NOT enforce client auth, preserving compatibility.

Fixes: #138

@tsautier
Copy link
Copy Markdown
Author

@mvangoor @hrxcodes for review

@tsautier tsautier force-pushed the feat/issue-138-cert-auth branch from 1e856b8 to 4d329d5 Compare January 14, 2026 21:59
Implemented support for mTLS client authentication in SlaveManager.

Added certificate fingerprint verification in RemoteSlave.

Introduced 'slavemanager.ssl.clientauth' and 'fingerprint' configuration properties.
@tsautier tsautier force-pushed the feat/issue-138-cert-auth branch from 4d329d5 to 1d12366 Compare January 14, 2026 22:19
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.

Certificate management

1 participant