You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/content/driver-async/tutorials/ssl.md
+16-2Lines changed: 16 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ To use TLS/SSL, you must configure the asynchronous driver to use [Netty](http:/
19
19
20
20
{{% note %}}
21
21
If your application requires Netty, it must explicitly add a dependency to
22
-
Netty artifacts. The driver is currently tested against Netty 4.0.
22
+
Netty artifacts. The driver is currently tested against Netty 4.1.
23
23
{{% /note %}}
24
24
25
25
### Via Connection String
@@ -36,7 +36,9 @@ You can also specify the connection string via the [`ConnectionString`]({{< apir
36
36
37
37
### Via `MongoClientSettings`
38
38
39
-
To specify TLS/SSL with [`MongoClientSettings`]({{< apiref "com/mongodb/async/client/MongoClientSettings.Builder.html#streamFactoryFactory-com.mongodb.connection.StreamFactoryFactory-">}}) , set the ``sslEnabled`` property to ``true``, and the stream factory to [`NettyStreamFactoryFactory`]({{< apiref "com/mongodb/connection/netty/NettyStreamFactoryFactory" >}}), as in
39
+
To specify TLS/SSL with [`MongoClientSettings`]({{< apiref "com/mongodb/async/client/MongoClientSettings.Builder.html#streamFactoryFactory-com.mongodb.connection.StreamFactoryFactory-">}}) ,
40
+
set the ``sslEnabled`` property to ``true``, and the stream factory to
41
+
[`NettyStreamFactoryFactory`]({{< apiref "com/mongodb/connection/netty/NettyStreamFactoryFactory" >}}), as in
40
42
41
43
```java
42
44
@@ -65,6 +67,18 @@ Netty may also be configured by setting the `org.mongodb.async.type` system prop
65
67
deprecated as of the 3.1 driver release.
66
68
{{% /note %}}
67
69
70
+
To override the default [`javax.net.ssl.SSLContext`](https://docs.oracle.com/javase/8/docs/api/javax/net/ssl/SSLContext.html) used for SSL
71
+
connections, set the `sslContext` property on the `SslSettings`, as in:
72
+
73
+
```java
74
+
SSLContext sslContext =...
75
+
SslSettings sslSettings =SslSettings.builder()
76
+
.enabled(true)
77
+
.sslContext(sslContext)
78
+
.build();
79
+
// Pass sslSettings to the MongoClientSettings.Builder
Copy file name to clipboardExpand all lines: docs/reference/content/driver/tutorials/ssl.md
+21-1Lines changed: 21 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,13 +35,33 @@ MongoClient mongoClient = new MongoClient(uri);
35
35
importcom.mongodb.MongoClientOptions;
36
36
```
37
37
38
-
To specify TLS/SSL with with [`MongoClientOptions`]({{<apiref "com/mongodb/MongoClientOptions">}}), set the ``sslEnabled`` property to ``true``, as in:
38
+
To specify TLS/SSL with with [`MongoClientOptions`]({{<apiref "com/mongodb/MongoClientOptions">}}), set the `sslEnabled` property to `true`, as in:
0 commit comments