I am getting "extension (5) should not be presented in certificate_request" when trying to run locally a Java Kubernetes client application which queries the Kubernetes cluster over a lube proxy connection. Any thoughts? Thanks in advance
ApiClient client = null;
try {
client = Config.defaultClient();
//client.setVerifyingSsl(false);
} catch (IOException e) {
e.printStackTrace();
}
Configuration.setDefaultApiClient(client);
CoreV1Api api = new CoreV1Api();
V1PodList list = null;
try {
list = api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null);
} catch (ApiException e) {
e.printStackTrace();
}
for (V1Pod item : list.getItems()) {
System.out.println(item.getMetadata().getName());
}
Which version of Java are you using?
JDK 11 onwards have support for TLS 1.3 which can cause the error extension (5) should not be presented in certificate_request
.
Add -Djdk.tls.client.protocols=TLSv1.2
to the JVM args to make it use 1.2
instead.
There is an issue on Go lang relating to this https://github.com/golang/go/issues/35722 and someone there also posted to disable TLS 1.3 on the Java side
Alternatively, upgrade your JDK to a more recent version to fix the problem.
Some min versions with this fix are: openjdk8u272, 11.0.7, 14.0.2
Instead of connecting via kubectl proxy connect to Kubernetes API Server directly from the application by providing a kubeconfig file to the Java client.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With