Skip to content

Commit 6079ea0

Browse files
d-bodhmlau
authored andcommitted
chore: tls README example
Signed-off-by: d-bo <[email protected]>
1 parent 16275c0 commit 6079ea0

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,26 @@ const config = {
134134

135135
Note: the port is not specified when using the `mongodb+srv` protocol and will be ignored if given.
136136

137+
### TLS/SSL Connections
138+
139+
Note: SSL options deprecated since MongoDB 4.2
140+
141+
```ts
142+
const config = {
143+
name: 'db',
144+
connector: 'mongodb',
145+
url: '',
146+
host: 'localhost',
147+
port: 27017,
148+
user: '',
149+
password: '',
150+
database: 'testdb',
151+
tls: true,
152+
tlsCertificateKeyFile: '/local/path/to/pem-file',
153+
tlsCAFile: '/local/path/to/ca-file',
154+
};
155+
```
156+
137157
## Security Considerations
138158

139159
MongoDB Driver allows the `$where` operator to pass in JavaScript to execute on the Driver which can be used for NoSQL Injection. See [MongoDB: Server-side JavaScript](https://docs.mongodb.com/manual/core/server-side-javascript/) for more on this MongoDB feature.

0 commit comments

Comments
 (0)