Skip to content

Commit 72c29ee

Browse files
committed
Added TLS configuration instructions in README.md
1 parent 116d137 commit 72c29ee

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,3 +342,44 @@ c.start(container_id, binds={
342342
}
343343
})
344344
```
345+
346+
Connection to daemon using HTTPS
347+
================================
348+
349+
*These instructions are docker-py specific. Please refer to
350+
http://docs.docker.com/articles/https/ first.*
351+
352+
* Authenticate server based on public/default CA pool
353+
354+
```python
355+
client = docker.Client(base_url='<https_url>', tls=True)
356+
```
357+
358+
* Authenticate server based on given CA
359+
360+
```python
361+
tls_config = docker.tls.TLSConfig(
362+
False, tls_verify=True, tls_ca_cert='/path/to/ca.pem')
363+
client = docker.Client(base_url='<https_url>', tls=tls_config)
364+
```
365+
366+
* Authenticate with client certificate, do not authenticate server
367+
based on given CA
368+
369+
```python
370+
tls_config = docker.tls.TLSConfig(
371+
True, tls_cert='/path/to/client-cert.pem',
372+
tls_key='/path/to/client-key.pem'
373+
)
374+
client = docker.Client(base_url='<https_url>', tls=tls_config)
375+
```
376+
377+
* Authenticate with client certificate, authenticate server based on given CA
378+
379+
```python
380+
tls_config = docker.tls.TLSConfig(
381+
False, tls_cert='/path/to/client-cert.pem',
382+
tls_key='/path/to/client-key.pem', tls_ca_cert='/path/to/ca.pem'
383+
)
384+
client = docker.Client(base_url='<https_url>', tls=tls_config)
385+
```

0 commit comments

Comments
 (0)