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 )
还没有人认领这个 Issue。
评估
调研方向
报告没有列出仓库文件。首先定位 maddy 的构建/配置文档和 TLS 设置,然后使用 Go 1.23,针对仅支持 RSA 密钥交换的服务器重现投递过程。与维护者确认范围是记录 workaround、改变 TLS 行为,还是两者兼有;完成内容应包括经过测试的兼容路径和更新后的指南。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Go
- 星标
- 6.1k
- 派生
- 327
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
foxcpp/maddy 的其他 Issue
-
ready-for-release
难度 1/5 1 小时以内 新手友好度 65/100
-
难度 2/5 1-3 小时 新手友好度 25/100
-
bug
难度 3/5 1-2 天 新手友好度 55/100
-
bug invalid
-
bug
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 60/100
github/gh-aw-mcpg#13748 ·
-
agentic-workflows
难度 2/5 1-3 小时 新手友好度 65/100
-
needs-triage
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 2/5 1-3 小时 新手友好度 75/100
googleapis/librarian#7670 · 2 条评论 ·