Skip to content

Commit 4310757

Browse files
Update manuals according to Drivers 5.0 changes (#335)
- Added a note about execute_read/execute_write replacing read_transaction/write_transaction, or their language-specific counterparts. - Made the TrustedCertificates config section language-dependent, and specify the possible values for each language. - Removed references to 3.x, except minor informative reminders. - Added note about the exception property CanBeRetried. - Mention Async Python driver.
1 parent 39f6b1b commit 4310757

File tree

16 files changed

+109
-620
lines changed

16 files changed

+109
-620
lines changed

common-content/modules/ROOT/partials/client-applications.adoc

+6-38
Original file line numberDiff line numberDiff line change
@@ -114,17 +114,7 @@ A connection URI identifies a graph database and how to connect to it.
114114

115115
The *_encryption_* and *_trust_* settings provide detail to how that connection should be secured.
116116

117-
[CAUTION]
118-
====
119-
*There are significant changes to security settings between Neo4j 3.x and Neo4j 4.x*
120-
121-
Please consider the information in this section before upgrading from a previous version.
122-
123-
The https://neo4j.com/docs/migration-guide/current/[Migration Guide] is also a good source of information about changes in functionality.
124-
====
125-
126117
Starting with *Neo4j 4.0*, client-server communication uses only *_unencrypted local connections by default_*.
127-
128118
This is a change from previous versions, which switched on encryption by default, but generated a self-signed certificate out of the box.
129119

130120
When a full certificate is installed, and encryption is enabled on the driver, full certificate checks are carried out (refer to link:/docs/operations-manual/5.0/security/ssl-framework[Operations Manual -> SSL framework]).
@@ -141,23 +131,6 @@ To connect to *Neo4j Aura*, driver users must *_enable encryption_* and the comp
141131
For more information, see xref:client-applications.adoc#driver-configuration-examples[Examples] below.
142132
====
143133

144-
# tag::default-security-changes[]
145-
146-
.Changes in default security settings between 3.x and 4.x
147-
[options="header"]
148-
|===
149-
| Setting | Neo4j 4.x | Neo4j 3.x (Drivers 1.x)
150-
| Bundled certificate | none | auto-generated, self-signed
151-
| Driver encryption | off | on
152-
| Bolt interface | localhost |localhost
153-
| Certificate expiry check | on |on
154-
| Certificate CA check | on | off
155-
| Certificate hostname check | on | off
156-
|===
157-
158-
# end::default-security-changes[]
159-
160-
161134
[[initial-address-resolution]]
162135
=== Initial address resolution
163136

@@ -1312,7 +1285,7 @@ Specify a custom server address resolver used by the routing driver to resolve t
13121285

13131286
Specify whether to use an encrypted connection between the driver and server.
13141287
+
1315-
*Default:* None
1288+
*Default:* False
13161289

13171290
# end::configuration-Encryption[]
13181291

@@ -1486,19 +1459,14 @@ include::{python-examples}/test_config_max_retry_time_example.py[tags=config-max
14861459

14871460
# tag::configuration-TrustStrategy[]
14881461

1489-
`TrustStrategy`::
1462+
`TrustedCertificates`::
14901463

1491-
Specify how to determine the authenticity of encryption certificates provided by the Neo4j instance that you are connecting to.
1492-
There are three choices as to which strategy to use:
1493-
1494-
* `TRUST_SYSTEM_CA_SIGNED_CERTIFICATES` - Accept any certificate that can be verified against the system store.
1495-
1496-
* `TRUST_CUSTOM_CA_SIGNED_CERTIFICATES` - Accept any certificate that can be verified against a custom CA.
1497-
1498-
* `TRUST_ALL_CERTIFICATES` - Accept any certificate provided by the server, regardless of CA chain. *We do not recommend using this setting for production environments.*
1464+
Specify how to determine the authenticity of encryption certificates provided by the Neo4j instance that you are connecting to.
1465+
If encryption is disabled, this option has no effect.
14991466

15001467
+
1501-
*Default:* `TRUST_SYSTEM_CA_SIGNED_CERTIFICATES` (Note - only when encryption is enabled)
1468+
1469+
Possible values are:
15021470

15031471
# end::configuration-TrustStrategy[]
15041472

common-content/modules/ROOT/partials/session-api.adoc

+3
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,11 @@ To that end, transaction functions can return values but these should be derived
9898
*_When a transaction fails, the driver retry logic is invoked_*.
9999
For several failure cases, the transaction can be immediately retried against a different server.
100100
These cases include connection issues, server role changes (e.g. leadership elections) and transient errors.
101+
101102
====
102103

104+
105+
103106
# end::simple-transaction-fn[]
104107

105108
[.tabbed-example]

dotnet-manual/modules/ROOT/pages/client-applications.adoc

+12-125
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@ include::{common-partial}/client-applications.adoc[tag=examples-pt2]
102102
.Connecting to a service
103103
The tables below illustrate examples of how to connect to a service with routing:
104104

105-
.Neo4j Aura, secured with full certificate
105+
.Neo4j Aura or Neo4j >= 4.x, secured with full certificate
106106
[cols="<15s,<85a"]
107107
|===
108108
| Product
109-
| Neo4j Aura
109+
| Neo4j Aura, Neo4j >= 4.x
110110

111111
| Security
112112
| Secured with full certificate
@@ -118,24 +118,15 @@ The tables below illustrate examples of how to connect to a service with routing
118118
GraphDatabase.Driver("neo4j+s://graph.example.com:7687", auth)
119119
----
120120

121-
If you do not have at least the .NET Driver 4.0.1 patch installed, you will need this snippet instead:
122-
123-
[source, csharp, indent=0]
124-
----
125-
String uri = "neo4j://graph.example.com:7687";
126-
IDriver driver = GraphDatabase.Driver(uri, auth,
127-
o => o.WithEncryptionLevel(EncryptionLevel.Encrypted));
128-
----
129-
130121
| Comments
131122
| This is the default (and only option) for Neo4j Aura.
132123
|===
133124

134-
.Neo4j 4.x, unsecured
125+
.Neo4j >= 4.x, unsecured
135126
[cols="<15s,<85a"]
136127
|===
137128
| Product
138-
| Neo4j 4.x
129+
| Neo4j >= 4.x
139130

140131
| Security
141132
| Unsecured
@@ -148,40 +139,14 @@ GraphDatabase.Driver("neo4j://graph.example.com:7687", auth);
148139
----
149140

150141
| Comments
151-
| This is the default for Neo4j 4.x series
142+
| This is the default for Neo4j >= 4.x series
152143
|===
153144

154-
.Neo4j 4.x, secured with full certificate
145+
.Neo4j >= 4.x, secured with self-signed certificate
155146
[cols="<15s,<85a"]
156147
|===
157148
| Product
158-
| Neo4j 4.x
159-
160-
| Security
161-
| Secured with full certificate
162-
163-
| Code snippet
164-
|
165-
[source, csharp, indent=0]
166-
----
167-
GraphDatabase.Driver("neo4j+s://graph.example.com:7687", auth)
168-
----
169-
170-
If you do not have at least the .NET Driver 4.0.1 patch installed, you will need this snippet instead:
171-
172-
[source, csharp, indent=0]
173-
----
174-
String uri = "neo4j://graph.example.com:7687";
175-
IDriver driver = GraphDatabase.Driver(uri, auth,
176-
o => o.WithEncryptionLevel(EncryptionLevel.Encrypted));
177-
----
178-
|===
179-
180-
.Neo4j 4.x, secured with self-signed certificate
181-
[cols="<15s,<85a"]
182-
|===
183-
| Product
184-
| Neo4j 4.x
149+
| Neo4j >= 4.x
185150

186151
| Security
187152
| Secured with self-signed certificate
@@ -192,89 +157,6 @@ IDriver driver = GraphDatabase.Driver(uri, auth,
192157
----
193158
GraphDatabase.Driver("neo4j+ssc://graph.example.com:7687", auth)
194159
----
195-
196-
If you do not have at least the .NET Driver 4.0.1 patch installed, you will need this snippet instead:
197-
198-
[source, csharp, indent=0]
199-
----
200-
String uri = "neo4j://graph.example.com:7687";
201-
IDriver driver = GraphDatabase.Driver(uri, auth,
202-
o => o.WithEncryptionLevel(EncryptionLevel.Encrypted)
203-
.WithTrustManager(TrustManager.CreateInsecure()));
204-
----
205-
|===
206-
207-
.Neo4j 3.x, secured with full certificate
208-
[cols="<15s,<85a"]
209-
|===
210-
| Product
211-
| Neo4j 3.x
212-
213-
| Security
214-
| Secured with full certificate
215-
216-
| Code snippet
217-
|
218-
[source, csharp, indent=0]
219-
----
220-
GraphDatabase.Driver("neo4j+s://graph.example.com:7687", auth)
221-
----
222-
223-
If you do not have at least the .NET Driver 4.0.1 patch installed, you will need this snippet instead:
224-
225-
[source, csharp, indent=0]
226-
----
227-
String uri = "neo4j://graph.example.com:7687";
228-
IDriver driver = GraphDatabase.Driver(uri, auth,
229-
o => o.WithEncryptionLevel(EncryptionLevel.Encrypted));
230-
----
231-
|===
232-
233-
.Neo4j 3.x, secured with self-signed certificate
234-
[cols="<15s,<85a"]
235-
|===
236-
| Product
237-
| Neo4j 3.x
238-
239-
| Security
240-
| Secured with self-signed certificate
241-
242-
| Code snippet
243-
|
244-
[source, csharp, indent=0]
245-
----
246-
GraphDatabase.Driver("neo4j+ssc://graph.example.com:7687", auth)
247-
----
248-
249-
If you do not have at least the .NET Driver 4.0.1 patch installed, you will need this snippet instead:
250-
251-
[source, csharp, indent=0]
252-
----
253-
String uri = "neo4j://graph.example.com:7687";
254-
IDriver driver = GraphDatabase.Driver(uri, auth,
255-
o => o.WithEncryptionLevel(EncryptionLevel.Encrypted)
256-
.WithTrustManager(TrustManager.CreateInsecure()));
257-
----
258-
259-
| Comments
260-
| This is the default for Neo4j 3.x series
261-
|===
262-
263-
.Neo4j 3.x, unsecured
264-
[cols="<15s,<85a"]
265-
|===
266-
| Product
267-
| Neo4j 3.x
268-
269-
| Security
270-
| Unsecured
271-
272-
| Code snippet
273-
|
274-
[source, csharp, indent=0]
275-
----
276-
GraphDatabase.Driver("neo4j://graph.example.com:7687", auth);
277-
----
278160
|===
279161

280162
[NOTE]
@@ -430,6 +312,11 @@ include::{dotnet-examples}/Examples.cs[tags=config-max-retry-time]
430312
======
431313

432314
include::{common-partial}/client-applications.adoc[tag=configuration-TrustStrategy]
315+
316+
* `TrustManager.CreateChainTrust()` - *[Default]* Accept any certificate that can be verified against the system store.
317+
* `TrustManager.CreateCertTrust(new []{"/path/ca1.crt", "/path/ca2.crt"})` - Accept certificates at specified paths.
318+
* `TrustManager.CreateInsecure()` - Accept any certificate, including self-signed ones. *Not recommended for production environments.*
319+
433320
+
434321
.Configure trusted certificates
435322
======

dotnet-manual/modules/ROOT/pages/cypher-workflow.adoc

+2
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,5 @@ Inbound conversion is carried out using http://cldr.unicode.org/development/deve
129129
== Exceptions and error handling
130130

131131
include::{common-partial}/cypher-workflow.adoc[tag=exceptions-errors]
132+
133+
The exception property `CanBeRetried` gives insights into whether a further attempt might be successful.

dotnet-manual/modules/ROOT/pages/session-api.adoc

+9
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ See xref:session-api.adoc#dotnet-driver-session-configuration[Session configurat
3232

3333
include::{common-partial}/session-api.adoc[tag=simple-transaction-fn]
3434

35+
[CAUTION]
36+
The methods `ExecuteRead` and `ExecuteWrite` have replaced `ReadTransaction` and `WriteTransaction`, which are deprecated in version 5.x and will be removed in version 6.0.
37+
3538
[source, csharp, indent=0]
3639
----
3740
include::{dotnet-examples}/Examples.cs[tags=transaction-function]
@@ -90,6 +93,9 @@ See xref:session-api.adoc#dotnet-driver-session-configuration[Session configurat
9093

9194
include::{common-partial}/session-api.adoc[tag=async-transaction-fn]
9295

96+
[CAUTION]
97+
The methods `ExecuteReadAsync` and `ExecuteWriteAsync` have replaced `ReadTransactionAsync` and `WriteTransactionAsync`, which are deprecated in version 5.x and will be removed in version 6.0.
98+
9399
[source, csharp, indent=0]
94100
----
95101
include::{dotnet-examples}/ExamplesAsync.cs[tags=async-transaction-function]
@@ -150,6 +156,9 @@ include::{common-partial}/session-api.adoc[tag=rx-lifecycle]
150156

151157
include::{common-partial}/session-api.adoc[tag=rx-transaction-fn]
152158

159+
[CAUTION]
160+
The methods `ExecuteRead` and `ExecuteWrite` have replaced `ReadTransaction` and `WriteTransaction`, which are deprecated in version 5.x and will be removed in version 6.0.
161+
153162
[source, csharp, indent=0]
154163
----
155164
include::{dotnet-examples}/ExamplesRx.cs[tags=rx-transaction-function]

0 commit comments

Comments
 (0)