Skip to content

okhttp: Skip enabling SNI and session ticket for fake/test host names - #6949

Merged
voidzcy merged 2 commits into
grpc:masterfrom
voidzcy:bugfix/disable_sni_for_test_host_name
Apr 21, 2020
Merged

okhttp: Skip enabling SNI and session ticket for fake/test host names#6949
voidzcy merged 2 commits into
grpc:masterfrom
voidzcy:bugfix/disable_sni_for_test_host_name

Conversation

@voidzcy

@voidzcy voidzcy commented Apr 20, 2020

Copy link
Copy Markdown
Contributor

No description provided.

// Enable SNI and session tickets.
if (hostname != null) {
// Skip if hostname is not a real internet domain name, which is usually used with
// test certificates.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmmm, don't like the idea of adding "special" code/workaround in main code to make tests pass. Why not modify test certs so they don't need special handling in mainline code?

@voidzcy voidzcy Apr 20, 2020

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.

Details in b/154375837. According to @ejona86, changing those test certs seems to be hard and we compromise to work them around.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

FWIW, SunJSSE ignores SNI if it is invalid (at least in some ways): #4912 (comment) .

While I could potentially agree using IDN is a good idea, it is a bit more subtle of a change. How would you feel about calling GrpcUtil.checkAuthority() (with try/catch) here instead? Then we could say that checkAuthority is normally performed in the builder so it should virtually always succeed. We then reference the bug id, and say we are working around cases where checkAuthority is disabled and we want to avoid them causing trouble here. We can also mention that underscore is the troublesome character.

Doing it that way makes it much more obvious this changes no behavior change for most users and makes it more obvious if/when it is no longer needed (e.g., because the broken certs have been replaced).

@voidzcy
voidzcy merged commit eb8e314 into grpc:master Apr 21, 2020
voidzcy added a commit to voidzcy/grpc-java that referenced this pull request Apr 21, 2020
voidzcy added a commit that referenced this pull request Apr 21, 2020
…#6959)

* Revert "okhttp: Skip enabling SNI and session ticket for fake/test host names (#6949)"

This reverts commit eb8e314.

* Revert "okhttp: use new APIs for configuring TLS whenever possible (Android Q+) (#6912)"

This reverts commit 5803dfd.
dfawley pushed a commit to dfawley/grpc-java that referenced this pull request Jan 15, 2021
…grpc#6949)

Work around for cases (usually for tests) where hostname is overridden for test certs and it is in invalid syntax.
dfawley pushed a commit to dfawley/grpc-java that referenced this pull request Jan 15, 2021
…grpc#6959)

* Revert "okhttp: Skip enabling SNI and session ticket for fake/test host names (grpc#6949)"

This reverts commit eb8e314.

* Revert "okhttp: use new APIs for configuring TLS whenever possible (Android Q+) (grpc#6912)"

This reverts commit 5803dfd.
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jun 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants