Skip to content

Commit 951ad82

Browse files
hovaescoebyhr
authored andcommitted
Document how to use verify parameter
1 parent 5c51cb8 commit 951ad82

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

README.md

+33
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,39 @@ cur.execute('SELECT * FROM system.runtime.nodes')
322322
rows = cur.fetchall()
323323
```
324324

325+
### SSL verification
326+
327+
In order to disable SSL verification, set the `verify` parameter to `False`.
328+
329+
```python
330+
from trino.dbapi import connect
331+
from trino.auth import BasicAuthentication
332+
333+
conn = connect(
334+
user="<username>",
335+
auth=BasicAuthentication("<username>", "<password>"),
336+
http_scheme="https",
337+
verify=False
338+
)
339+
```
340+
341+
### Self-signed certificates
342+
343+
To use self-signed certificates, specify a path to the certificate in `verify` parameter.
344+
More details can be found in [the Python requests library documentation](https://requests.readthedocs.io/en/latest/user/advanced/#ssl-cert-verification).
345+
346+
```python
347+
from trino.dbapi import connect
348+
from trino.auth import BasicAuthentication
349+
350+
conn = connect(
351+
user="<username>",
352+
auth=BasicAuthentication("<username>", "<password>"),
353+
http_scheme="https",
354+
verify="/path/to/cert.crt"
355+
)
356+
```
357+
325358
## Transactions
326359

327360
The client runs by default in *autocommit* mode. To enable transactions, set

0 commit comments

Comments
 (0)