-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
IPv6 Service Address TLS Hostname Verification Fails #1289
Comments
This comment has been minimized.
This comment has been minimized.
Thanks for reporting. We'd be happy to take a PR to address this. |
OkHttps
Unfortunately IPv6 addresses in TLS certificate SAN fields are stored in uncompressed format (ie.
https://tools.ietf.org/html/rfc5280#section-4.2.1.6 OkHostnameVerifier's deviation from the standard causes issues in the field. Fortunately this is fixed starting from OkHttp 4.5.0. Issue leading to the fix: square/okhttp#5885 It seems possible to workaround this by overriding the OkHttp dependencies in build.gradle (or pom.xml):
Please update the OkHttp library. |
We'll look into updating. 3.x to 4.x is a big jump in versioning, so we'll need to validate that it works and/or do it across a major version update. (which fortunately we're about to do) |
@brendanburns I updated to 4.9.0 for testing purposes. The method to make the kubernetes CA certificate known to the HTTP client doesn't work anymore. The CA certificate from the crafted TrustManager is not accepted and one gets a "No certification path" exception:
|
After some debugging I found that my dependency injection framework injected a No-Arg constructor created ApiClient instance in my SharedInformerFactory instances. Sorry for the inconvenience. I wish the No-Arg constructors for ApiClient, CoreV1Api, SharedInformerFactory and similar could be replaced by static factory methods like |
Seems like the original issue is still valid, though. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-contributor-experience at kubernetes/community. |
@fejta-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I use client-java:16.0.0. my kubernetes version is 1.21. |
@lyind How can I fix this issue |
@njucjc It's long fixed (by OkHttp client upgrade and later switch to Vert.x). Also make sure you setup a provider for a configured You may want to do similar for |
Kubernetes 1.19.1 (for example when setup using
kubeadm
) does not - by default - sign the IPv6 short-form of the api-server address.Unfortunately kubernetes-client/java (version 10.0.0) uses the short-form string representation of the
kubernetes
service ClusterIp in the URL, which leads to the following exception:Valid alternatives could be to either use the full (un-shortened) IPv6 address (
2a01:4f8:d0:1601:0:0:0:1
in my case) or just use the default DNS namekubernetes
. People looking to avoid the service name lookup, ie. for performance/reliability reasons, could instantiate the client separately.This issue is somewhat related to the (fixed): #839
The text was updated successfully, but these errors were encountered: