You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
masque/warp: make warp.publicKey optional (CA/pcs verify for custom SNI) #7115
#6878 added WARP over MASQUE. warp.publicKey pins the server leaf SPKI (transport/internet/masque/warp.go:57-70), correct for the default self-signed backend (consumer-masque.cloudflareclient.com → 162.159.198.2, CN=masque..., IaU7..., leaf-only, no chain per author note).
Problem
infra/conf/transport_method.go:825-828 mandates the pin via parseWarpPublicKey → decodeWarpKey:914-918 (empty key error). infra/conf/masque_test.go:173 enforces it.
With a custom SNI to a WARP IP (tlsSettings.serverName=www.cloudflare.com, masqueSettings.host=cloudflareaccess.com, same split Aether --masque-sni uses), the presented leaf is the rotating CDN WE1/Google cert, not the enrollment key. Forcing a leaf SPKI pin there gives per-PoP/rotation the WARP endpoint's key doesn't match "publicKey" (warp.go:69), and the leaf hash changes while WE1/R4 CAs are stable (xray tls ping -ip 162.159.198.11 www.cloudflare.com).
Proposal
Allow empty warp.publicKey in infra/conf only; transport already supports it (warp.go:57 if len(publicKey)>0, otherwise only client-cert setup, standard verify preserved):
changed the title [-][Feature Request] masque/warp: make warp.publicKey optional (CA/pcs verify for custom SNI)[/-][+]masque/warp: make warp.publicKey optional (CA/pcs verify for custom SNI)[/+]on Oct 9, 2026
changed the pinnedPeerCertSha256 and err returned as expected; though pubkey is required , i filled it in & with correct pinnedPeerCertSha256 , it works fine.
the expected err with wrong pinnedPeerCertSha256:
2026/10/10 10:34:05.763610 [Info] [3465903607] app/proxyman/outbound: app/proxyman/outbound: failed to process outbound traffic > proxy/masque: failed to establish CONNECT-IP tunnel > transport/internet/tls: peer cert is unrecognized (against pinnedPeerCertSha256)
21. For games, UDP is more suitable for PLUX, as mentioned earlier, allowing the same UDP packets to be sent simultaneously on multiple paths. Otherwise, waiting for single TCP retransmissions or reconnections would be agonizing.
the problem now is not udp , it's TCP ACKs , obviously , udp is not my concern ; i should've explained this earlier:
In Iran , as you may know , most of the useful domain are Sanctioned , not blocked , I'm not talking about Media like Instagram or youtube , I'm talking about google storage api , sign up domains and etc... meaning that they block access if the IP is from Iran and mostly return code 403 .
We proxy The tcp traffic to evade these situations; so the concept is not about Game UDP , it's about TCP that if it's slowed , the whole game will slow aswell .
The main traffic of games are on UDP , Agreed , but the Content delivery e.g. loading Game character's skin & some actions that need to be acknowledged remain on TCP and if they are delayed , regardless of UDP packets which have no problem , the whole Game session will delay and feel laggy.
21. > 19. I'm saying this as a reminder & a history record: As long as there is no ACK mechanism & no decoupling between proxy & apps session, using mux & xmux will only worsen the connection performance eventualy (regardless of their benefits, only in terms of stability) ; mobile networks , ADSL Setups & etc... right now cannot even tolerate the normal connection failures at proxy level , let alone using (x)mux that leads this to a more worse connection quality; Quic was introduced to address this, but because it's normally blocked for foreign IPs in Russia & Iran ( I don't know about China ), This ACK mechanism will replace Connection Migration & benefits of QUIC which can be added to (x)mux. This Decouplization should be an Standard , not a demand so that it's simply responded : "due to complexity , this FR is Closed as not Planned " .
> In the future , we'll be heading towards this , closing FRs won't help it. This should be as i said, an Standard , not an even irrevelant matter!
Are several people's networks experiencing connection drops every minute, just to introduce a ACK state management system with thousands of lines of code involving various states? TCP painstakingly abstracted away things that are now being reintroduced, something HTTP/2 didn't even do. Just the Windows Update function, designed to handle head-of-line congestion, already causes a huge amount of trouble.
Fang brother, These things are obviously not expected to be said by you , i must be the one that being adviced...
Are you really setting your Standards based on how many people use/encounter that?! ; if so , then there have been several discussions in chinese groups recent years about sahdowsocks , ws on port 80 & etc... , most of ordinary people used it , but should you abide by that and lower your standards?
I didn't ask for immediate PR and commits, this is about pushing that to an standard level so it becomes higher priority.
"Why would you introduce a thousand-line ACK state management system involving all kinds of states just because a few users have networks like yours, where one connection drops every minute? TCP went to great lengths to abstract away these complexities, and now you're bringing them back in? Even HTTP/2 doesn't do this kind of thing. Just look at how much trouble the window update mechanism, which exists to deal with head-of-line blocking, has already caused." translated by ChatGPT
I'll be responding to this.
I'm obviously not debating about the complexities as it is indeed complex.
what I'm trying to say is that TCP can't retransmit the application data on a new connection that passes that RST to Application.
what i'm saying is much more similar to PLUX , but with some excess notes.
Also , the reason of dropped connection is important , whether it's due to packet loss or mux or any other situation?
you can have many mux workers to reduce the possibility of your request being blocked; what can you do about firewall? ; the main reason is not that a packet loss happens and connection dies , it's about firewall interfering and closing the connection , you don't need to go far , ask @patterniha about 6 packet limits on cf domains/ips , this explains how insophisticated the firewall is and doesn't care about anything.
about the connection drops , do you think that all people use FTTH or 5G ? ; atleast it takes years to develop such a thing in Iran ; the Art of a network tool is to bring flexibility & stable connection; I'm trying to say that layering a proxy on packets should produce nearly 0 problems so that ordinary protocol mechanisms such as TCP can do their job , when the RST of proxy failure passes to application , then there is no chance for TCP to recover; this is in line with network basics that we prefer to lower the point of failure, if proxy connection failure does not mean application failure , then we remove the point of failure that proxy introduces which is inherent to the existance of proxy.
that's why i'm saying that we should move towards this, not preventing idealization; and that is the reason I'm calling it an Standard, because removing the POF would directly strengthen the connection reliebility and quality.
you're talking about bandwidth & potentials , I'm talking about the inherent of network and their failures.
a proxy tool like xray should be transparent and be more like it never existed or added transport layer on top of ordinary packets.
I'm not rejecting your concerns , my POV is different.
the whole point that one of the guys debated with @RPRX was because of a maxconnections:3 ; didn't RPRX know that this would introduce characteristics? ofcourse he did ; the trade off was losing reliability and stability ( QOS ) vs Firewall taking action ; network is all about stability and performance , My POV is a kind of Idealization and is much closer to PLUX , though I'm being rejected due to some reasons...
I've also mentioned that the cache timeout can be configured and the memory concern is just something the users can adopt with.
tested on v26.10.10 against warp over h2, sni www.cloudflare.com on 162.159.198.2:
-- publicKey only: connects, from my exit the edge still serves the masque self-signed cert for that sni
-- right pinnedPeerCertSha256: connects, and it still connects with a wrong publicKey, so publicKey is really skipped
-- wrong pinnedPeerCertSha256: refused with "peer cert is unrecognized" even though publicKey matches
-- verifyPeerCertByName www.cloudflare.com: refused, the cert here is the self-signed one, so it would only pass where the edge hands out the real cdn cert
same with the original sni consumer-masque.cloudflareclient.com: the edge serves the same self-signed cert, so publicKey and the right pinnedPeerCertSha256 connect, a wrong hash is refused, and verifyPeerCertByName never passes since the cert is self-signed and its name is masque.cloudflareclient.com. publicKey is still the better pin there, it pins the key so it keeps working if a cert renewal keeps the key, pcs pins the whole cert
@RPRX
By the way , I've got some reports from people testing xdrive acknowledging my slow speed experience. #7090 (comment)
I should test it further myself, since then , i haven't tested any... ; but when i got the report of slow speed , i thought it might either be the code or google that's causing this slowness or maybe the params, I'll try to check the codes later if i had time with the help of AI.
just reporting because you've said the focus is on xdrive , so you have an acknowledgement of speed slowness before hand.
it's still fresh & need more testing...
please don't forget about the confusing config structure of xdrive.#6748 (comment)
31. @RPRX
By the way , I've got some reports from people testing xdrive acknowledging my slow speed experience. #7090 (comment)
I should test it further myself, since then , i haven't tested any... ; but when i got the report of slow speed , i thought it might either be the code or google that's causing this slowness or maybe the params, I'll try to check the codes later if i had time with the help of AI.
just reporting because you've said the focus is on xdrive , so you have an acknowledgement of speed slowness before hand.
it's still fresh & need more testing...
please don't forget about the confusing config structure of xdrive.#6748 (comment)
the speed is few kilobytes, very similar to TXT DNS connection methods.
ifid, err:=s.resolveID(ctx, flat); err==nil {
s.deleteID(...)
}
children, err:=s.query(ctx, "name contains '"+flat+flatSeparator+"'")
// always runs, even for a single .seg leaf
The recursive search exists so Delete can clean whole session prefixes (same contract as local os.RemoveAll). On the hot path it is pure waste: every segment delete still pays an extra List. Impact on Google Drive: each segment currently costs ~2–3 API round-trips instead of 1–2. With concurrency 16–32 this alone can consume 30–50 % of the shared 32-inflight quota and push the account into rate-limit backoff. After fix (skip children query for .seg/.end/.err): roughly 30–50 % fewer API calls per segment → higher sustained throughput (often +0.5–1.5 MB/s) and lower chance of multi-second stalls from 429s.
wal.go – Write / flushLocked (L73–176)
w.wg.Add(1)
gow.upload(seq, chunk) // never blocks the caller
Intentionally non-blocking so upper layers keep the normal net.Conn contract. Side-effect: unbounded queue and burst-then-stall behaviour. Impact on Google Drive: interactive traffic (page loads, YouTube) sees multi-second latency spikes even when raw bandwidth is fine, because the application floods the queue and then waits for the cloud to catch up. After fix (bounded in-flight window): Write starts blocking once a few MiB are outstanding. Latency for small requests drops from seconds to roughly one Drive RTT (typically 0.4–0.8 s one-way). Throughput becomes stable instead of bursty; YouTube 360p and ordinary browsing become usable.
wal.go reader + drive.go List (wal.go L290–291, drive.go L537–571)
listed, err:=r.storage.List(r.ctx, r.prefix) // every reader, independently// drive.go does a full-folder "name contains" search
Drive has no push, so polling is required; sharing one storage object is intentional. The missing piece is a short shared list cache. Impact on Google Drive: with several concurrent sessions the List traffic alone can saturate the 32-inflight limit, leaving almost no room for actual Put/Get/Delete. Rate-limit collapse follows, dropping speed from MB/s to tens of KB/s. After fix (30–50 ms shared list cache / coalescing): List QPS falls dramatically. The 32 slots stay available for data movement, sustained throughput stays in the 1–2+ MB/s range instead of collapsing, and recovery from temporary rate limits becomes much faster.
Today , I've got some time to test different params & various settings for xdrive; I found that using only one mux worker e.g. concurrency 1024 can reduce the overhead & makes the flow more fluent; though the critical problems remain in the code.
ofcurse , having only one worker comes with tradeoffs , though this is crucial for latency , especially for xdrive . you may have seen the TGs multiple requests/s , this alone would shape most of the concurrency of traffic... I'm not sure whether the policy settings would also take part here , will handshake timeout of 4s interrupt the flow?, what about uplink/downlink only for in-flight requests?
Activity
[-][Feature Request] masque/warp: make warp.publicKey optional (CA/pcs verify for custom SNI)[/-][+]masque/warp: make warp.publicKey optional (CA/pcs verify for custom SNI)[/+]masque/warp: make warp.publicKey optional (CA/pcs verify for custom SNI)
RPRX commentedon Oct 9, 2026
@CluvexStudio 测测能不能连,其实这个改成 pcs/vcn 的优先级高于 pin 公钥就行了,前者若存在就只按它们来验证,不存在才对比 leaf 公钥
RPRX commentedon Oct 10, 2026
看了下代码,
tlsConfig.VerifyPeerCertificate一定不为 nil,所以这个得先判断下 randCarrier 有没有 pcs 或 vcn,有的话就只按它们来验证而如果按 @Ahmad-2213 的设想不强制要求写 WARP 公钥的话也是要判断下 randCarrier 有没有 pcs 或 vcn 不然就没验证了,所以按我说的吧anonymously-hidden commentedon Oct 10, 2026
@RPRX ; this is what i use for my custom fork & it works ,
pinnedPeerCertSha256can be obtained by xray tls command & this will allow DomanFronting.masque/warp: pcs/vcn priority over leaf pin
RPRX commentedon Oct 10, 2026
想到一个更好的写法,@Ahmad-2213 测试 5c42b4c ,
记得测一下服务端发来的证书不符合 pcs/vcn 时应当 failMASQUE client: Ignore `publicKey` in `warp` when pcs/vcn exists
RPRX commentedon Oct 10, 2026
所以写if xxx == true是能过 fmt check 的,那就这样吧,看起来更直观些MASQUE client: Ignore `publicKey` in `warp` when pcs/vcn exists (doma…
anonymously-hidden commentedon Oct 10, 2026
changed the
pinnedPeerCertSha256and err returned as expected; though pubkey is required , i filled it in & with correctpinnedPeerCertSha256, it works fine.the expected err with wrong
pinnedPeerCertSha256:2026/10/10 10:34:05.763610 [Info] [3465903607] app/proxyman/outbound: app/proxyman/outbound: failed to process outbound traffic > proxy/masque: failed to establish CONNECT-IP tunnel > transport/internet/tls: peer cert is unrecognized (against pinnedPeerCertSha256)anonymously-hidden commentedon Oct 10, 2026
any new necessary change in aa7aa9a ?
seems like the sameRPRX commentedon Oct 10, 2026
那就行,配置层面仍要求
publicKey,这个没必要不填,删掉 pcs/vcn 就能改为靠它来验证没有,Xray 绝大多数 force-push 只是为了改 commit message,否则会在讨论中进行说明anonymously-hidden commentedon Oct 10, 2026
cc @patterniha ; now xray-core also supports it.
9 remaining items
anonymously-hidden commentedon Oct 10, 2026
the problem now is not udp , it's TCP ACKs , obviously , udp is not my concern ; i should've explained this earlier:
In Iran , as you may know , most of the useful domain are Sanctioned , not blocked , I'm not talking about Media like Instagram or youtube , I'm talking about google storage api , sign up domains and etc... meaning that they block access if the IP is from Iran and mostly return code 403 .
We proxy The tcp traffic to evade these situations; so the concept is not about Game UDP , it's about TCP that if it's slowed , the whole game will slow aswell .
The main traffic of games are on UDP , Agreed , but the Content delivery e.g. loading Game character's skin & some actions that need to be acknowledged remain on TCP and if they are delayed , regardless of UDP packets which have no problem , the whole Game session will delay and feel laggy.
anonymously-hidden commentedon Oct 10, 2026
Fang brother, These things are obviously not expected to be said by you , i must be the one that being adviced...
Are you really setting your Standards based on how many people use/encounter that?! ; if so , then there have been several discussions in chinese groups recent years about sahdowsocks , ws on port 80 & etc... , most of ordinary people used it , but should you abide by that and lower your standards?
I didn't ask for immediate PR and commits, this is about pushing that to an standard level so it becomes higher priority.
Fangliding commentedon Oct 10, 2026
your translator misunderstood my meaning, try ask llm
anonymously-hidden commentedon Oct 10, 2026
"Why would you introduce a thousand-line ACK state management system involving all kinds of states just because a few users have networks like yours, where one connection drops every minute? TCP went to great lengths to abstract away these complexities, and now you're bringing them back in? Even HTTP/2 doesn't do this kind of thing. Just look at how much trouble the window update mechanism, which exists to deal with head-of-line blocking, has already caused." translated by ChatGPT
I'll be responding to this.
I'm obviously not debating about the complexities as it is indeed complex.
what I'm trying to say is that TCP can't retransmit the application data on a new connection that passes that RST to Application.
what i'm saying is much more similar to PLUX , but with some excess notes.
Also , the reason of dropped connection is important , whether it's due to packet loss or mux or any other situation?
you can have many mux workers to reduce the possibility of your request being blocked; what can you do about firewall? ; the main reason is not that a packet loss happens and connection dies , it's about firewall interfering and closing the connection , you don't need to go far , ask @patterniha about 6 packet limits on cf domains/ips , this explains how insophisticated the firewall is and doesn't care about anything.
about the connection drops , do you think that all people use FTTH or 5G ? ; atleast it takes years to develop such a thing in Iran ; the Art of a network tool is to bring flexibility & stable connection; I'm trying to say that layering a proxy on packets should produce nearly 0 problems so that ordinary protocol mechanisms such as TCP can do their job , when the RST of proxy failure passes to application , then there is no chance for TCP to recover; this is in line with network basics that we prefer to lower the point of failure, if proxy connection failure does not mean application failure , then we remove the point of failure that proxy introduces which is inherent to the existance of proxy.
that's why i'm saying that we should move towards this, not preventing idealization; and that is the reason I'm calling it an Standard, because removing the POF would directly strengthen the connection reliebility and quality.
you're talking about bandwidth & potentials , I'm talking about the inherent of network and their failures.
a proxy tool like xray should be transparent and be more like it never existed or added transport layer on top of ordinary packets.
I'm not rejecting your concerns , my POV is different.
anonymously-hidden commentedon Oct 10, 2026
the whole point that one of the guys debated with @RPRX was because of a maxconnections:3 ; didn't RPRX know that this would introduce characteristics? ofcourse he did ; the trade off was losing reliability and stability ( QOS ) vs Firewall taking action ; network is all about stability and performance , My POV is a kind of Idealization and is much closer to PLUX , though I'm being rejected due to some reasons...
I've also mentioned that the cache timeout can be configured and the memory concern is just something the users can adopt with.
anonymously-hidden commentedon Oct 10, 2026
Decoupling is the whole Idea & it reduces point of failures; it's the Utopia of a tool like xray-core in terms of reliability.
CluvexStudio commentedon Oct 10, 2026
tested on v26.10.10 against warp over h2, sni www.cloudflare.com on 162.159.198.2:
-- publicKey only: connects, from my exit the edge still serves the masque self-signed cert for that sni
-- right pinnedPeerCertSha256: connects, and it still connects with a wrong publicKey, so publicKey is really skipped
-- wrong pinnedPeerCertSha256: refused with "peer cert is unrecognized" even though publicKey matches
-- verifyPeerCertByName www.cloudflare.com: refused, the cert here is the self-signed one, so it would only pass where the edge hands out the real cdn cert
so pcs/vcn taking priority works as intended
CluvexStudio commentedon Oct 10, 2026
same with the original sni consumer-masque.cloudflareclient.com: the edge serves the same self-signed cert, so publicKey and the right pinnedPeerCertSha256 connect, a wrong hash is refused, and verifyPeerCertByName never passes since the cert is self-signed and its name is masque.cloudflareclient.com. publicKey is still the better pin there, it pins the key so it keeps working if a cert renewal keeps the key, pcs pins the whole cert
anonymously-hidden commentedon Oct 10, 2026
@RPRX
By the way , I've got some reports from people testing
xdriveacknowledging my slow speed experience. #7090 (comment)I should test it further myself, since then , i haven't tested any... ; but when i got the report of slow speed , i thought it might either be the code or google that's causing this slowness
or maybe the params, I'll try to check the codes later if i had time with the help of AI.just reporting because you've said the focus is on
xdrive, so you have an acknowledgement of speed slowness before hand.it's still fresh & need more testing...
please don't forget about the confusing config structure of
xdrive.#6748 (comment)megasoheilsh commentedon Oct 10, 2026
the speed is few kilobytes, very similar to TXT DNS connection methods.
RPRX commentedon Oct 12, 2026
#7130 (comment) @4RH1T3CT0R7 比较擅长优化 performance,先让他改改 XDRIVE 看看
anonymously-hidden commentedon Oct 12, 2026
AI assessment:
anonymously-hidden commentedon Oct 12, 2026
If the Delete's API consumption is true , then the 32 Concurrency Cap after the fix can be lifted or raised to a higher numberanonymously-hidden commentedon Oct 12, 2026
Today , I've got some time to test different params & various settings for
xdrive; I found that using only one mux worker e.g. concurrency 1024 can reduce the overhead & makes the flow more fluent; though the critical problems remain in the code.ofcurse , having only one worker comes with tradeoffs , though this is crucial for latency , especially for
xdrive.you may have seen the TGs multiple requests/s , this alone would shape most of the concurrency of traffic...I'm not sure whether the policy settings would also take part here , will handshake timeout of 4s interrupt the flow?, what about uplink/downlink only for in-flight requests?RPRX commentedon Oct 12, 2026
@Ahmad-2213 其实你可以让 AI 改代码后你先测测有没有提升,然后发个 PR,
毕竟我都没弄 Google Drive API 测试,别等下对 Google 实名了你多想想理论,调大 VLESS Mux 的 concurrency 肯定能减少对 XDRIVE 传输层的“传入连接”从而减少一些 API 调用,
这就是为啥 mux 也需大整XDRIVE 应当改为每条“传入连接(VLESS Mux)”都对应一条 TCP/QUIC 而不应 mux over mux,另外后续讨论都发到 #6748
别东一块西一块的