-
Notifications
You must be signed in to change notification settings - Fork 983
HttpsSupport: Omit public suffix matcher from default hostname verifier #647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The use of public suffix matching as part of hostname verification is nonstandard. I can't find anything in the TLS specifications that prescribe or even mention this behavior, having checked: * RFC 8446: The Transport Layer Security (TLS) Protocol Version 1.3 * RFC 9110: HTTP Semantics * RFC 9525: Service Identity in TLS There are of course rules for wildcard matching, but ultimately the question of whether to trust a certificate for `*.com` is up to the CAs in your trust store. Given the oddity of the PSL matching behavior and the non-trivial runtime overhead of loading and querying the PSL, I think it makes more sense for the default `HostnameVerifier` to not use this behavior.
|
@rschmitt |
@rschmitt TLS represents non-trivial runtime overhead in general and the hostname verification is a very marginal part of it. I am not in favor of disabling hostname validation against PLS by default. It is not useless. What we can do, though, is to switch |
|
**I don’t see any justification for removing public-suffix matching here. Cookie management and TLS hostname verification are orthogonal concerns, and bundling them together is confusing.; |
@arturobernalg I can probably explain the confusion. The PSL can be used by both the cookie policy and the host name verifier. One may choose to disable PSL checks either for the state management, the TLS security, or both. What @rschmitt is proposing is to disable it for the TLS security by default (not that I agree with the proposal) but there is no risk of Cookie management and TLS hostname verification coupling here. |
|
@ok2c I'm not familiar with |
@rschmitt Precisely. The Using
|
|
Wouldn't updated Javadocs (class or package) help future readers? There is a lot of good information in this thread. |
|
@rschmitt Apparently the RFC that specifies the expected client behavior is 6125. It does not explicitly mention the PSL but it is not a stretch to suggest that clients are expected to take public suffices into account when checking wildcards in certificates. The best course of action would not have to do the hostname verification at all. |
This doesn't sound unreasonable, although I do use client-mode verification for some advanced use cases that I wouldn't know how to reimplement using the JDK verifier. |
@rschmitt There is nothing stopping you from making use of fa custom hostname verifier in addition to the built-in one or instead of it. |
|
Superseded by d89fdfe |
The use of public suffix matching as part of hostname verification is nonstandard. I can't find anything in the TLS specifications that prescribe or even mention this behavior, having checked:
There are of course rules for wildcard matching, but ultimately the question of whether to trust a certificate for
*.comis up to the CAs in your trust store. Given the oddity of the PSL matching behavior and the non-trivial runtime overhead of loading and querying the PSL, I think it makes more sense for the defaultHostnameVerifierto not use this behavior.