feat(mail): Allow SMTP to skip tls certificate validation#1726
Open
Zerek-Cheng wants to merge 2 commits intoWei-Shaw:mainfrom
Open
feat(mail): Allow SMTP to skip tls certificate validation#1726Zerek-Cheng wants to merge 2 commits intoWei-Shaw:mainfrom
Zerek-Cheng wants to merge 2 commits intoWei-Shaw:mainfrom
Conversation
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题背景
后台邮件设置里只有“使用 TLS”,没有“跳过 TLS 证书信任校验”这个选项。
这样一来,只要 SMTP 服务用了自签名证书,或者证书链配得不完整,测试连接和实际发信都会失败,后台也没有地方保存这类配置。(特殊内网场景下也只能自签了)
本次修改
smtp_skip_tls_verify,默认是关闭false验证
cd backend && go test -tags unit ./internal/service -run TestSettingService_UpdateSettings_SMTPFlags -count=1cd backend && go test -tags unit ./internal/server -run TestAPIContracts -count=1