Skip to content

Commit cc842e5

Browse files
authored
API docs: explain security config options interplay (#1244)
1 parent 28f4a83 commit cc842e5

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

docs/source/api.rst

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,25 @@ Each supported scheme maps to a particular :class:`neo4j.Driver` subclass that i
7979
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
8080
| URI Scheme | Driver Object and Setting |
8181
+========================+=======================================================================================================================================+
82-
| bolt | :ref:`bolt-driver-ref` with no encryption. |
82+
| bolt | :ref:`bolt-driver-ref` with no encryption or with custom encryption configuration, see :ref:`driver-configuration-ref`. |
8383
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
8484
| bolt+ssc | :ref:`bolt-driver-ref` with encryption (accepts self signed certificates). |
8585
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
8686
| bolt+s | :ref:`bolt-driver-ref` with encryption (accepts only certificates signed by a certificate authority), full certificate checks. |
8787
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
88-
| neo4j | :ref:`neo4j-driver-ref` with no encryption. |
88+
| neo4j | :ref:`neo4j-driver-ref` with no encryption or with custom encryption configuration, see :ref:`driver-configuration-ref`. |
8989
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
9090
| neo4j+ssc | :ref:`neo4j-driver-ref` with encryption (accepts self signed certificates). |
9191
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
9292
| neo4j+s | :ref:`neo4j-driver-ref` with encryption (accepts only certificates signed by a certificate authority), full certificate checks. |
9393
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
9494

95+
96+
.. note::
97+
98+
See also :ref:`encryption-config-note-ref` to understand how the URI scheme relates to other encryption configuration options.
99+
100+
95101
.. note::
96102

97103
See https://neo4j.com/docs/operations-manual/current/configuration/ports/ for Neo4j ports.
@@ -173,6 +179,8 @@ Additional configuration can be provided via the :class:`neo4j.Driver` construct
173179
+ :ref:`trust-ref`
174180
+ :ref:`user-agent-ref`
175181

182+
:ref:`encryption-config-note-ref`
183+
176184

177185
.. _session-connection-timeout-ref:
178186

@@ -367,6 +375,9 @@ This setting does not have any effect if ``encrypted`` is set to ``False``.
367375
certificate authority. This option is primarily intended for use with
368376
full certificates.
369377

378+
The driver loads the trusted system CAs using Python's
379+
:meth:`ssl.SSLContext.load_default_certs`.
380+
370381
:Default: ``neo4j.TRUST_SYSTEM_CA_SIGNED_CERTIFICATES``.
371382

372383

@@ -381,6 +392,22 @@ Specify the client agent name.
381392

382393

383394

395+
.. _encryption-config-note-ref:
396+
397+
Note on Encryption Configuration
398+
--------------------------------
399+
There are different *mutually exclusive* ways of configuring TLS/SSL encryption behavior of the driver:
400+
401+
* Use a URI scheme ending in ``+s``. This auto-configures the driver to use TLS and only trust system CAs.
402+
* Use a URI scheme ending in ``+ssc``. This auto-configures the driver to use TLS and trust any certificate.
403+
* Use a URI scheme without suffix (i.e. ``neo4j://`` or ``bolt://``) and one of the following mutually exclusive options:
404+
405+
* set :ref:`encrypted-ref` to ``True`` and optionally configure :ref:`trust-ref` to enable TLS with custom security
406+
settings.
407+
* or set ``encrypted=False`` (default) to disable TLS.
408+
409+
410+
384411
Driver Object Lifetime
385412
======================
386413

0 commit comments

Comments
 (0)