Skip to content

Commit c5925a9

Browse files
committed
Improve SSL docs for security
1 parent d3664dd commit c5925a9

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

docs/security.rst

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,16 @@ For example:
7474
.. code-block:: python
7575
7676
from cassandra.cluster import Cluster
77-
from ssl import PROTOCOL_TLSv1
77+
from ssl import PROTOCOL_TLSv1, CERT_REQUIRED
7878
79-
ssl_opts = {'ca_certs': '/path/to/my/ca.certs',
80-
'ssl_version': PROTOCOL_TLSv1}
79+
ssl_opts = {
80+
'ca_certs': '/path/to/my/ca.certs',
81+
'ssl_version': PROTOCOL_TLSv1,
82+
'cert_reqs': CERT_REQUIRED # Certificates are required and validated
83+
}
8184
cluster = Cluster(ssl_options=ssl_opts)
8285
83-
For further reading, Andrew Mussey has published a thorough guide on
86+
This is only an example to show how to pass the ssl parameters. Consider reading
87+
the `python ssl documentation <https://docs.python.org/2/library/ssl.html#ssl.wrap_socket>`_ for
88+
your configuration. For further reading, Andrew Mussey has published a thorough guide on
8489
`Using SSL with the DataStax Python driver <http://blog.amussey.com/post/64036730812/cassandra-2-0-client-server-ssl-with-datastax-python>`_.

0 commit comments

Comments
 (0)