Skip to content
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

Kubectl works, python API doesn't: unsupported cert purpose (solved?) #800

Open
bensternlieb opened this issue Aug 1, 2024 · 0 comments

Comments

@bensternlieb
Copy link

Hi,

After setup on 3 RaspberryPIs, kubectl behaves as expected. However, python client code was failing with:

[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unsupported certificate purpose 

This can be fixed by the following changes in ca.conf:

diff --git a/ca.conf b/ca.conf
index eb17657..2cd028e 100644
--- a/ca.conf
+++ b/ca.conf
@@ -174,8 +174,7 @@ req_extensions     = kube-api-server_req_extensions
 basicConstraints     = CA:FALSE
 extendedKeyUsage     = clientAuth, serverAuth
 keyUsage             = critical, digitalSignature, keyEncipherment
-nsCertType           = client
-nsComment            = "Kube Scheduler Certificate"
+nsComment            = "Kube API Server Certificate"

Handy to use the openssl command:

openssl x509 -in kube-api-server.crt -purpose -noout

Not sure if this is the right way to address this issue, and it's weird that kubectl doesn't barf, but now python code works as expected:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant