Fix occasional SSL protocol error in XTLS Vision direct copy mode#5520
Draft
Fix occasional SSL protocol error in XTLS Vision direct copy mode#5520
Conversation
Member
|
|
…copy when rawInput has pending data Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix issue identified in XTLS Vision code
Fix occasional SSL protocol error in XTLS Vision direct copy mode
Jan 11, 2026
Member
|
@yuhan6665 @Fangliding 你们怎么看, |
Member
|
|
Member
|
疑难杂症 AI 解决不了 |
15 tasks
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.
Fixes occasional
ERR_SSL_PROTOCOL_ERROR/ERR_SSL_BAD_RECORD_MAC_ALERTwhen using VLESS + XTLS Vision + Reality. The issue is more frequent withtestpre(pre-connect) enabled.Root Cause
When Vision switches to direct copy mode (bypassing outer TLS for splice), it was merging
rawInputbytes into the output buffer. TherawInputbuffer in Go'scrypto/tls.Connmay contain encrypted bytes for partial TLS records not yet processed, corrupting the data stream.Changes
rawInputmerging: Only mergeinput(decrypted application data) into the bufferrawInputhas pending data: IfrawInputis not empty, return early and retry on next read cycle, allowing the TLS layer to process remaining encrypted bytesw.input == nilcheck to ensure fast-path only triggers after switch is completeReference: #5169
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
go.googlesource.comCo-authored-by: RPRX <63339210+RPRX@us--wait 0.1-go1.25.0.linux-amd64/pkg/tool/linux_amd64/compile -p gvisor.dev/gviso-d t 0.1-go1.25.0.linux-amd64/pkg/too-buildtags` (dns block)
Co-authored-by: RPRX <63339210+RPRX@us--wait 0.1-go1.25.0.linux-amd64/pkg/tool/linux_amd64/compile -p gvisor.dev/gviso-d t 0.1-go1.25.0.linux-amd64/pkg/too-buildtags` (dns block)
Co-authored-by: RPRX <63339210+RPRX@us--wait 0.1-go1.25.0.linux-amd64/pkg/tool/linux_amd64/compile -p gvisor.dev/gviso-d t 0.1-go1.25.0.linux-amd64/pkg/too-buildtags` (dns block)
Co-authored-by: RPRX <63339210+RPRX@us--wait 0.1-go1.25.0.linux-amd64/pkg/tool/linux_amd64/compile -p gvisor.dev/gviso-d t 0.1-go1.25.0.linux-amd64/pkg/too-buildtags` (dns block)
Co-authored-by: RPRX <63339210+RPRX@us--wait 0.1-go1.25.0.linux-amd64/pkg/tool/linux_amd64/compile -p gvisor.dev/gviso-d t 0.1-go1.25.0.linux-amd64/pkg/too-buildtags` (dns block)
Co-authored-by: RPRX <63339210+RPRX@us--wait 0.1-go1.25.0.linux-amd64/pkg/tool/linux_amd64/compile -p gvisor.dev/gviso-d t 0.1-go1.25.0.linux-amd64/pkg/too-buildtags` (dns block)
Co-authored-by: RPRX <63339210+RPRX@us--wait 0.1-go1.25.0.linux-amd64/pkg/tool/linux_amd64/compile -p gvisor.dev/gviso-d t 0.1-go1.25.0.linux-amd64/pkg/too-buildtags` (dns block)
Co-authored-by: RPRX <63339210+RPRX@us--wait 0.1-go1.25.0.linux-amd64/pkg/tool/linux_amd64/compile -p gvisor.dev/gviso-d t 0.1-go1.25.0.linux-amd64/pkg/too-buildtags` (dns block)
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.