Skip to content

Implement basic IRCv3 SASL PLAIN authentication#501

Open
tsautier wants to merge 1 commit intodrftpd-ng:masterfrom
tsautier:fix/issue-57
Open

Implement basic IRCv3 SASL PLAIN authentication#501
tsautier wants to merge 1 commit intodrftpd-ng:masterfrom
tsautier:fix/issue-57

Conversation

@tsautier
Copy link
Copy Markdown

@tsautier tsautier commented Jan 14, 2026

Problem

SiteBot could not connect to modern IRC networks that require IRCv3 SASL authentication. The existing IRC client implementation lacked CAP negotiation and SASL support.

Solution

Implement IRCv3 SASL PLAIN authentication in the SiteBot module without a full library rewrite.

Changes Made

1. Configuration (ServerConfig.java)

  • Added _saslUsername and _saslPassword fields
  • Added getter methods getSaslUsername() and getSaslPassword()

2. Config Parsing (SiteBotConfig.java)

  • Modified readProperties() to parse server.X.sasl.username and server.X.sasl.password

3. Connection Logic (SiteBot.java)

  • Added CAP LS 302 command on connection when SASL credentials are configured
  • Handle CAP negotiation (CAP REQ :sasl, CAP ACK, CAP NAK)
  • Send AUTHENTICATE PLAIN with Base64-encoded credentials
  • Handle SASL response codes:
    • 903 = Success → send CAP END
    • 904/905 = Failure → log error and disconnect

4. Configuration Template (irc.conf.dist)

Added example configuration:

server.1.sasl.username=mybot
server.1.sasl.password=secretpassword

Usage

  1. Set server.1.sasl.username and server.1.sasl.password in irc.conf
  2. Restart the bot or use SITE RELOAD
  3. Bot will now authenticate via SASL when connecting

Fixes: #57

@tsautier
Copy link
Copy Markdown
Author

@mvangoor @hrxcodes for review

@tsautier tsautier force-pushed the fix/issue-57 branch 2 times, most recently from ad3c594 to 9ad0876 Compare January 14, 2026 19:55
@tsautier tsautier changed the title Fix/issue 57 Implement basic IRCv3 SASL PLAIN authentication Jan 14, 2026
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.

IRCv3

1 participant