summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMoisés Guimarães de Medeiros <moisesguimaraes@users.noreply.github.com>2020-04-07 12:33:08 -0300
committerGitHub <noreply@github.com>2020-04-07 08:33:08 -0700
commitf35f21573ca816171e22b927925d76d5a47fc334 (patch)
tree47fdd7f73865270bc4269822966bcc8bd9b33d4e /docs
parentda89f48496493bf9075d8531e26dae42e0fd0dd9 (diff)
downloadpymemcache-f35f21573ca816171e22b927925d76d5a47fc334.tar.gz
Add TLS support for TCP sockets (#276)
Diffstat (limited to 'docs')
-rw-r--r--docs/getting_started.rst24
1 files changed, 24 insertions, 0 deletions
diff --git a/docs/getting_started.rst b/docs/getting_started.rst
index 4e1b9ef..25690e6 100644
--- a/docs/getting_started.rst
+++ b/docs/getting_started.rst
@@ -41,6 +41,30 @@ on if a server goes down.
client.set('some_key', 'some value')
result = client.get('some_key')
+
+Using TLS
+---------
+**Memcached** `supports <https://github.com/memcached/memcached/wiki/TLS>`_
+authentication and encryption via TLS since version **1.5.13**.
+
+A Memcached server running with TLS enabled will only accept TLS connections.
+
+To enable TLS in pymemcache, pass a valid TLS context to the client's
+``tls_context`` parameter:
+
+.. code-block:: python
+ import ssl
+ from pymemcache.client.base import Client
+
+ context = ssl.create_default_context(
+ cafile="my-ca-root.crt",
+ )
+
+ client = Client(('localhost', 11211), tls_context=context)
+ client.set('some_key', 'some_value')
+ result = client.get('some_key')
+
+
Serialization
--------------