Skip to content

Retry at most once when ECH fails - #9664

Merged
swankjesse merged 2 commits into
mainfrom
jwilson.0813.more_retry_tests
Aug 14, 2026
Merged

Retry at most once when ECH fails#9664
swankjesse merged 2 commits into
mainfrom
jwilson.0813.more_retry_tests

Conversation

@swankjesse

Copy link
Copy Markdown
Collaborator

Also write some new ECH retry tests.

Also enforce restrictions on public_name structure.

Also rename EchRetryConfig to EchRetryPlan.

// From https://cs.android.com/android/platform/superproject/+/android-latest-release:external/conscrypt/platform/src/main/java/org/conscrypt/Platform.java;bpv=0
// we can get neither, publicHostname only, or both. Conscrypt only hands us an EchConfigList
// if it is non-empty and self-consistent; BoringSSL does the real validation (version checks
// and such) when we hand the list back to it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Docs now in the EchRetry class

}
if (!retryable) return null
// If this was an ECH retry, don't retry again.
if (echRetryPlan != null) return null

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fix: previously we’d permit one retry with a EchConfigList once, and another retry with no EchConfigList. I believe we should be limited to one retry total.

@@ -503,26 +505,15 @@ class ConnectPlan internal constructor(
): ConnectPlan? {
if (!retryOnConnectionFailure) return null

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

For follow-up, I believe we need to reorder these so we do an ECH retry even when this is false.

* See RFC 9849, section 6.1.6.
*/
@OkHttpInternalApi
class EchRetryPlan private constructor(

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Renamed from EchRetryConfig

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It's grown on me already

assertInvalid("1:2::3:4")
assertInvalid("10.20.30.40")
assertInvalid("ech.example.com.")
assertInvalid(".ech.example.com")

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Our existing hostname checks permit this

)
val publicServer =
server.copy(
keyManager = untrustedServerCertificates.keyManager,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This one isn’t signed by our CA

@swankjesse
swankjesse force-pushed the jwilson.0813.more_retry_tests branch from 7f14f27 to c970b18 Compare August 13, 2026 22:11
Base automatically changed from jwilson.0813.securely_disable_ech_test to main August 14, 2026 03:16
Also write some new ECH retry tests.

Also enforce restrictions on public_name structure.

Also rename EchRetryConfig to EchRetryPlan.
@swankjesse
swankjesse force-pushed the jwilson.0813.more_retry_tests branch from c970b18 to 4c53b33 Compare August 14, 2026 03:22
@swankjesse
swankjesse merged commit bb61c63 into main Aug 14, 2026
22 of 26 checks passed
@swankjesse
swankjesse deleted the jwilson.0813.more_retry_tests branch August 14, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants