Skip to content

certificate verify failed #1017

Closed
Closed
@misrn

Description

@misrn

python 3.7
client 10.0.1

from kubernetes import client, config
config.kube_config.load_kube_config(config_file="F:\\config.yaml")
class Kubernetes:

    def __init__(self):
        self.Connect = client.CoreV1Api()

    def list_namespaces(self):
        data = []
        for ns in self.Connect.list_namespace().items:
            data.append(ns)
        return data
k = Kubernetes()
print(k.list_namespaces())

urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='172.18.56.103', port=6443): Max retries exceeded with url: /api/v1/namespaces (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get issuer certificate (_ssl.c:1056)')))

Can't verify the certificate. What should I do?

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions