Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

TLS Connection Failure with Go 1.22+ Due to Disabled RSA Cipher Suites (Version 0.7.1 is good, but problems occur in later versions )

Open
#789 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
go
Domain
backend, security

Research direction

The report does not name repository files. Start by locating maddy's build/configuration documentation and TLS setup, then reproduce delivery with Go 1.23 against a server supporting only RSA key exchange. Confirm with maintainers whether the scope is documenting the workaround, changing TLS behavior, or both; done should include a tested compatibility path and updated guidance.

Written by the indexing model from the issue text.

Description

bug

Problem Description
After upgrading maddy to compile with Go 1.23 (or Go 1.22+), sending emails to certain mail servers fails due to TLS handshake errors. This occurs because Go 1.22+ removed support for the insecure RSA key exchange cipher suites by default. Remote servers that only support these legacy cipher suites (e.g., TLS_RSA_WITH_*) reject the connection, preventing email delivery.

Root Cause
As documented in Go's release notes (Go 1.22 and Go 1.23):

Go 1.22 removed RSA key exchange-based cipher suites from the default TLS configuration.

Go 1.23 further removed 3DES-based suites.
This causes compatibility issues with older mail servers still relying on RSA key exchange.

Proposed Solutions

Compile-Time Workaround
Re-enable RSA support via the GODEBUG flag during compilation:

bash
GODEBUG=tlsrsakex=1 go build ./cmd/maddy
Configuration File Workaround
Explicitly specify legacy-compatible cipher suites in maddy.conf:

go
tls {
ciphers "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 TLS_RSA_WITH_AES_128_CBC_SHA"

Add other required suites (prioritize ECDHE where possible)

}
Note: Include TLS_RSA_WITH_* suites only if strictly necessary, as they are less secure.

Recommendations

Documentation: Update build/configuration docs to warn users about Go 1.22+ compatibility issues and provide the above workarounds.

Fallback Logic: Consider adding runtime warnings when TLS handshakes fail due to cipher mismatches, suggesting recompilation with tlsrsakex=1 or config adjustments.

Reproduction Steps

Compile maddy with Go 1.23 (no custom GODEBUG).

Attempt delivery to a server enforcing RSA key exchange (e.g., older Exchange/SMTP services).

Observe TLS handshake failure in logs:

text
tls: no cipher suite supported by both client and server
References

Go TLS defaults: crypto/tls/common.go

Go 1.22 release notes: tlsrsakex=1

Thank you for maintaining maddy! Let me know if further details are needed.

Dominant language
Go
Stars
6.1k
Forks
327
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from foxcpp/maddy

All issues in foxcpp/maddy

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.