Skip to content

Commit 3dafad6

Browse files
committed
Update README
1 parent 190f9af commit 3dafad6

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,25 @@ async with NanoKVMClient(
105105
await client.authenticate("username", "password")
106106
```
107107

108-
#### Option 2: Use custom CA certificate (recommended)
108+
#### Option 2: Certificate pinning (recommended for self-signed)
109+
110+
NanoKVM devices generate self-signed certificates for `localhost` with no CA to verify against. Certificate pinning verifies the server's certificate fingerprint directly instead of relying on CA-based trust.
111+
112+
```python
113+
from nanokvm.utils import async_fetch_remote_fingerprint
114+
115+
# First, fetch the fingerprint (trust-on-first-use)
116+
fingerprint = await async_fetch_remote_fingerprint("https://kvm.local/api/")
117+
118+
# Then connect with the pinned fingerprint
119+
async with NanoKVMClient(
120+
"https://kvm.local/api/",
121+
pinned_ca_cert_hash=fingerprint,
122+
) as client:
123+
await client.authenticate("username", "password")
124+
```
125+
126+
#### Option 3: Use custom CA certificate
109127

110128
```python
111129
async with NanoKVMClient(

0 commit comments

Comments
 (0)