kragniz / kragniz/python-etcd3

Python etcd3 client library is not able to read ca cert

Open
#2,614 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
450
Forks
194
PR merge metrics
No merged PRs in 30d

Description

I am trying to take a snapshot of etcd via etcd3 python client library and my code looks like this :

```
import etcd3
etcd = etcd3.client(
host='xx.xx.xx.xx',
port='2379',
cert_cert='/etc/kubernetes/pki/etcd/server.crt',
cert_key='/etc/kubernetes/pki/etcd/server.key',
ca_cert='/etc/kubernetes/pki/etcd/ca.crt'
)
print("Client connected:", etcd)
etcd.snapshot('etcd_backup.db')
print("Snapshot taken successfully.")
except Exception as e:
print("Error:", e)
```

I am getting this error
![image](https://github.com/user-attachments/assets/fc30f5f1-2bcb-46ae-ab63-71d8cd1b24df)

And if I remove the ca_cert path then I `get ETCD connection failed.`

What did you expect to happen?
I expect etcd3 client to recognize ca cert and get connected to etcd

How can we reproduce it (as minimally and precisely as possible)?
Install pip install etcd3 python etcd client library

Etcd version
![image](https://github.com/user-attachments/assets/155615d7-e223-4418-90ef-91e5550bb4fc)

Contributor guide

Open the contributing guide

Research direction

Start at the etcd3.client entry point and inspect how cert_cert, cert_key, and ca_cert are passed into the connection setup. Reproduce the reported connection failure with the certificate paths shown, then verify that a client can connect and complete snapshot('etcd_backup.db') when the CA certificate is supplied.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.