Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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 )

未关闭
#789 0 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
go
领域
backend, security

调研方向

报告没有列出仓库文件。首先定位 maddy 的构建/配置文档和 TLS 设置,然后使用 Go 1.23,针对仅支持 RSA 密钥交换的服务器重现投递过程。与维护者确认范围是记录 workaround、改变 TLS 行为,还是两者兼有;完成内容应包括经过测试的兼容路径和更新后的指南。

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Go
星标
6.1k
派生
327
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

foxcpp/maddy 的其他 Issue

查看 foxcpp/maddy 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。