Skip to content

Commit

Permalink
Merge pull request #181 from aerospike/doc_update
Browse files Browse the repository at this point in the history
Add TLS example and fix security guide link
  • Loading branch information
Jeff Boone committed Jul 19, 2017
2 parents 8fa54e6 + 581b514 commit 3fb925b
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
38 changes: 38 additions & 0 deletions doc/aerospike.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,44 @@ in an in-memory primary index.
.. versionchanged:: 2.0.0


.. code-block:: python
import aerospike
import sys
# NOTE: Use of TLS Requires Aerospike Enterprise Server Version >= 3.11 and Python Client version 2.1.0 or greater
# To view Instructions for server configuration for TLS see https://www.aerospike.com/docs/guide/security/tls.html
tls_name = "some-server-tls-name"
tls_ip = "127.0.0.1"
tls_port = 4333
# If tls-name is specified, it must match the tls-name specified in the node’s server configuration file
# and match the server’s CA certificate.
tls_host_tuple = (tls_ip, tls_port, tls_name)
hosts = [tls_host_tuple]
# Example configuration which will use TLS to encrypt only
tls_config = {
"cafile": "/path/to/cacert.pem",
"enable": True,
"encrypt_only": True,
}
client = aerospike.client({
"hosts": hosts,
"tls": tls_config
})
try:
client.connect()
except Exception as e:
print(e)
print("Failed to connect")
sys.exit()
key = ('test', 'demo', 1)
client.put(key, {'aerospike': 'aerospike'})
print(client.get(key))
.. py:function:: null()
A type for distinguishing a server-side null from a Python :py:obj:`None`.
Expand Down
4 changes: 2 additions & 2 deletions doc/client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ a cluster-tending thread.
established to a seed node (any single node in the cluster from which the client \
learns of the other nodes).

.. seealso:: `Security features article <https://www.aerospike.com/docs/guide/security.html>`_.
.. seealso:: `Security features article <https://www.aerospike.com/docs/guide/security/index.html>`_.

.. method:: is_connected()

Expand Down Expand Up @@ -2314,7 +2314,7 @@ a cluster-tending thread.
print("Error [{0}]: {1}".format(e.code, e.msg))
client.close()
.. seealso:: `Security features article <https://www.aerospike.com/docs/guide/security.html>`_.
.. seealso:: `Security features article <https://www.aerospike.com/docs/guide/security/index.html>`_.
.. method:: admin_create_role(role, privileges[, policy])
Expand Down

0 comments on commit 3fb925b

Please sign in to comment.