REALITY client: Clearer log when receiving real certificate#5427
Merged
REALITY client: Clearer log when receiving real certificate#5427
Conversation
Member
|
如果有人看到了这个 log 那说明有福报了 #5066 (comment) 要改成先判断 if show 的话要在外面再加个 error 级别的警报,比如你的连接被重定向了/你正在遭受中间人攻击 |
Contributor
Author
|
I have updated the code based on your feedback. I added errors.LogError outside the spider loop. This ensures the user receives a clear, high-severity warning about the verification failure (potential MITM/Redirection) exactly once. To be honest, the raw DialTLSContext print message didn't mean much to 99% of users and was mostly seen as log spam. By replacing the repetitive prints with a single, clear Error log, we keep the "blessing" of the security warning, but in a format that users can actually understand and act upon. |
This was referenced Jan 13, 2026
1 task
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.
The fmt.Printf call inside UClient's DialTLSContext was executing unconditionally.
This caused log pollution when using xray-core as a library dependency, printing to stdout even when debug mode was disabled.(REALITY localAddr: xxx DialTLSContext)
This patch wraps the print statement with
if config.Show, consistent with other debug logs in the file.This cleans up the output when using the package as a library.