Skip to content

Conversation

patterniha
Copy link
Collaborator

@patterniha patterniha commented Aug 3, 2025

#4949 (comment)

Yes, I just neglected this.

In case of a doh fails, the connection will be made for 6 hours and try to update the key. If it is unsuccessful within these 6 hours to get the new-key(even empty), then the connection will not be made.

@patterniha patterniha changed the title TLS ECH client: any query failure should be considered a failure regardless of force-query . Aug 3, 2025
@patterniha patterniha changed the title . TLS ECH client: any query failure should be considered a failure regardless of force-query Aug 3, 2025
@patterniha patterniha changed the title TLS ECH client: any query failure should be considered a failure regardless of force-query TLS ECH client: any query failure should be considered a failure regardless of force-query(after 6 hours) Aug 3, 2025
@RPRX RPRX changed the title TLS ECH client: any query failure should be considered a failure regardless of force-query(after 6 hours) TLS ECH client: Revert echForceQuery's behavior Aug 3, 2025
@RPRX RPRX merged commit 01c72df into XTLS:main Aug 3, 2025
39 checks passed
@Fangliding
Copy link
Member

这不还是dns服务器不可用的时候强制失败

@patterniha
Copy link
Collaborator Author

This is not a forced failure when the DNS server is unavailable

??? if DNS if fails, we have error other than emptyResponse, so the connection will not made. what is the problem?

@RPRX
Copy link
Member

RPRX commented Aug 3, 2025

被你们整晕了,总之查询失败就是失败,不要管是不是 emptyResponse,然后 force-query 与否有不同的逻辑

@patterniha 你看下当前代码的逻辑是否符合 #4949 (comment) ,不符合的话我删掉最新的 commit,你重新 PR

@Fangliding
Copy link
Member

被你们整晕了,总之查询失败就是失败,不要管是不是 emptyResponse,然后 force-query 与否有不同的逻辑

@patterniha 你看下当前代码的逻辑是否符合 #4949 (comment) ,不符合的话我删掉最新的 commit,你重新 PR

现在这样是没 force query 的话 错误是emptyresponse 连接成功 不然强制失败 以及只缓存 emptyresponse

@RPRX
Copy link
Member

RPRX commented Aug 3, 2025

@Fangliding 那我把这个 commit 删了,你 PR 修一下吧

@patterniha
Copy link
Collaborator Author

@RPRX

let explain:

A: ech DNS query fails, get no response
B: ech DNS query is successful, and receiving response is successful, but no ech-record found.
C: ech DNS query is successful, and ech-record received.

S1: if C, connection is made with ech-TLS.
S2: if A, connection is not made.
S3: if B, if echForceQuery is true, connection is not made, otherwise connection is made with plain-SNI, also we cache emptyRecord for 5 minutes.

@RPRX

this is my logic, because ech may be used in MitM-uses, what is your logic?

please say your logic and I implemented that.

@Fangliding
Copy link
Member

我觉得mitm继续用分片就是了 没必要硬用ech

@patterniha
Copy link
Collaborator Author

@Fangliding @RPRX

can you please say your logic exactly?

I think we can reach an agreement with three mode echForceQuery.

but I still doesn't know your exact logic.

@RPRX
Copy link
Member

RPRX commented Aug 3, 2025

@patterniha 我们的意思是把 AB 视为同一种情况,然后走 S3 的逻辑

@patterniha
Copy link
Collaborator Author

patterniha commented Aug 3, 2025

but suppose our internet is dropped for just a seconds, so we get no response and we cache this fail for 5 minutes !!!

and we don't try to use ech-TLS, or getting new key for 5 minutes !!!

this is not help for my MitM-use and if fragment blocked, this cause connection fail for 5 minutes.

///

@RPRX

so I implement three mode echForceQuery:

full: -> equal to current true
half: -> equal to current false
none: -> equal to your logic for false.

is it OK?

@RPRX
Copy link
Member

RPRX commented Aug 3, 2025

echForceQuery 这样吧:

  • "none": 非强制,懒查询,默认值(非必须查到,任何失败都是五分钟后再尝试;对于 emptyResponse,也是等五分钟)
  • "half": 非强制,积极查询(非必须查到,但每次尝试,不用等五分钟;对于 emptyResponse,等五分钟)
  • "full": 强制,故积极查询(必须查到,否则不连接;对于 emptyResponse,下次重新查)

对于 "none" 和 "half",第一次等查询,后面不等查询(但这次查到了会带 TTL 缓存,下次就能用),避免影响体验

@patterniha
Copy link
Collaborator Author

OK, please wait...

@RPRX

This comment was marked as outdated.

@patterniha
Copy link
Collaborator Author

ok, i only subdivide that for showing errors.

@RPRX
Copy link
Member

RPRX commented Aug 3, 2025

还有对于 "none" 和 "half",第一次可以等查询,后面就别等了(不知道现在是不是这个逻辑)

其实更简单的逻辑是如果 echForceQuery 填 false 就每次都尝试查询,但除了第一次,可以先建立连接

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.

3 participants