Skip to content

Commit d3283a0

Browse files
committed
Fixes ssl configuration in README according to recent changes
1 parent e6ffea6 commit d3283a0

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1389,20 +1389,20 @@ Hazelcast allows you to encrypt socket level communication between Hazelcast mem
13891389

13901390
#### 6.1.2. TLS/SSL for Hazelcast Node.js Clients
13911391

1392-
Hazelcast Node.js clients which support TLS/SSL should have the following user supplied SSL `options` object, to pass to
1393-
[`tls.connect`](https://nodejs.org/api/tls.html#tls_tls_connect_options_callback) of Node.js:
1392+
TLS/SSL for the Hazelcast Node.js client can be configured using the `SSLConfig` class. In order to turn it on, `enabled` property of `SSLConfig` should be set to `true`:
13941393

13951394
```javascript
13961395
var fs = require('fs');
13971396

13981397
var clientConfig = new Config.ClientConfig();
1399-
clientConfig.networkConfig.sslOptions = {
1400-
rejectUnauthorized: true,
1401-
ca: [fs.readFileSync(__dirname + '/server-cert.pem')],
1402-
servername: 'foo.bar.com'
1403-
};
1398+
var sslConfig = new Config.SSLConfig();
1399+
sslConfig.enabled = true;
1400+
clientConfig.networkConfig.sslConfig = sslConfig;
14041401
```
14051402

1403+
`SSLConfig` object takes various SSL options defined in the [Node.js TLS Documentation](https://nodejs.org/api/tls.html#tls_tls_connect_options_callback). You can set your custom options
1404+
object to `sslConfig.sslOptions`.
1405+
14061406
#### 6.1.3. Mutual Authentication
14071407

14081408
As explained above, Hazelcast members have key stores used to identify themselves (to other members) and Hazelcast clients have trust stores used to define which members they can trust.

src/config/Config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {ImportConfig} from './ImportConfig';
2424
import {InMemoryFormat} from './InMemoryFormat';
2525
import {ListenerConfig} from './ListenerConfig';
2626
import {NearCacheConfig} from './NearCacheConfig';
27+
import {SSLConfig} from './SSLConfig';
2728
import {Properties} from './Properties';
2829
import {ReliableTopicConfig} from './ReliableTopicConfig';
2930
import {SerializationConfig} from './SerializationConfig';
@@ -139,3 +140,5 @@ export {NearCacheConfig};
139140
export {ImportConfig};
140141

141142
export {FlakeIdGeneratorConfig};
143+
144+
export {SSLConfig};

0 commit comments

Comments
 (0)