Skip to content

TLS ECH DoH h2c: Support verifyPeerCertByName's "fromMitm" (after dialerProxy, in RAW outbound's tlsSettings) - #6246

Merged
RPRX merged 3 commits into
XTLS:mainfrom
j2rong4cn:ech-hoh-h2c-mitm
Oct 10, 2026
Merged

RPRX merged 3 commits into
XTLS:mainfrom
j2rong4cn:ech-hoh-h2c-mitm

Conversation

@j2rong4cn

Copy link
Copy Markdown
Contributor

ECH使用 DOH(h2c) 进行查询支持"fromMitm"

@Fangliding

Copy link
Copy Markdown
Member

没想到这样有什么用 SNI直接写在出站不就是了 这个又不会变

@Fangliding Fangliding closed this Jun 2, 2026
Comment thread transport/internet/tls/ech.go Outdated
utils.TryDefaultHeadersWith(req.Header, "fetch")
req.Header.Set("X-Padding", utils.H2Base62Pad(crypto.RandBetween(100, 1000)))

req.URL.Scheme = "https"

@j2rong4cn j2rong4cn Jun 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我是改这里顺便加上的

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Fangliding h2c没改Scheme直接报错了
{CA137595-EF13-48D2-8DD4-083B2C5C4A99}

@patterniha

patterniha commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

#6261 (comment)

  • one "fromMitm" outbound can be shared by built-in-DNS-DOH and by ECH-DOH
  • outbounds with different ECH-DoH servers can share one dialerProxy outbound
  • GUI clients can generate one such outbound without parsing echConfigList
  • align logic with built-in-DNS-DOH

@patterniha patterniha reopened this Sep 26, 2026
patterniha added a commit to patterniha/Xray-core that referenced this pull request Sep 26, 2026
Early merge of XTLS#6246 (PR head 705fa16), squashed, ahead of
it landing upstream: XTLS#6246

Co-authored-by: patterniha <[email protected]>
@patterniha

Copy link
Copy Markdown
Collaborator

in fact the main reason i open this PR is because i want to use one fixed outbound for all ECHs that users set in PattNG

@patterniha

patterniha commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

@RPRX

‍‍Don't forget

@RPRX

RPRX commented Sep 30, 2026

Copy link
Copy Markdown
Member

这个下次再合吧,你那个 N&G 应该用的是 fork 版 Xray-core 吧,可以先试试

@patterniha

patterniha commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Let's combine this next time. Your N&G is probably using a forked version of Xray-core, right? You can try that first.

Yes, but it would be better if the exported JSON worked in all clients. Anyway, there's no rush

@patterniha

Copy link
Copy Markdown
Collaborator

.

@RPRX

RPRX commented Oct 8, 2026

Copy link
Copy Markdown
Member

@patterniha 其它类似的代码段贴出来,我对比下

@patterniha

Copy link
Copy Markdown
Collaborator

@patterniha 其它类似的代码段贴出来,我对比下

dnsCtx := toDnsContext(ctx, s.dohURL)
if h2c {
dnsCtx = session.ContextWithMitmAlpn11(dnsCtx, false) // for insurance
dnsCtx = session.ContextWithMitmServerName(dnsCtx, url.Hostname())
}
link, err := dispatcher.Dispatch(dnsCtx, dest)

@RPRX RPRX changed the title TLS ECH DoH h2c : Add verifyPeerCertByName "fromMitm" support TLS ECH DoH h2c: Support verifyPeerCertByName's "fromMitm" (after dialerProxy, in RAW outbound's tlsSettings) Oct 10, 2026
@RPRX
RPRX merged commit cf8f11a into XTLS:main Oct 10, 2026
40 checks passed
RPRX pushed a commit that referenced this pull request Oct 10, 2026
…dialerProxy`, in RAW outbound's `tlsSettings`) (#6246)

#6246 (comment)

Like 613c63b

---------

Co-authored-by: patterniha <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants