@@ -49,32 +49,34 @@ describe("Client with SSL enabled", function () {
4949 return Controller . shutdownCluster ( cluster . id ) ;
5050 } ) ;
5151
52- function createCluster ( ) {
53- return Controller . createCluster ( null , serverConfig ) . then ( function ( response ) {
52+ function createCluster ( sConfig ) {
53+ return Controller . createCluster ( null , sConfig ) . then ( function ( response ) {
5454 cluster = response ;
5555 return Controller . startMember ( cluster . id ) ;
5656 } ) ;
5757 }
5858
5959 it ( 'should not be able to connect to the server with invalid certificate' , function ( ) {
60- serverConfig = serverConfig . replace ( '[serverCertificate]' , 'com/hazelcast/nio/ssl-mutual-auth/server1.keystore' ) ;
61- serverConfig = serverConfig . replace ( '[password]' , 'password' ) ;
62- return createCluster ( ) . then ( function ( ) {
60+ var sConfig = serverConfig
61+ . replace ( '[serverCertificate]' , 'com/hazelcast/nio/ssl-mutual-auth/server1.keystore' )
62+ . replace ( '[password]' , 'password' ) ;
63+ return createCluster ( sConfig ) . then ( function ( ) {
6364 var clientConfig = new Config . ClientConfig ( ) ;
6465 clientConfig . networkConfig . sslConfig . enabled = true ;
6566 return expect ( HazelcastClient . newHazelcastClient ( clientConfig ) ) . to . be . rejectedWith ( Errors . IllegalStateError ) ;
6667 } )
6768 } ) ;
6869
6970 it ( 'should be able to connect to the server with valid certificate' , function ( ) {
70- serverConfig = serverConfig . replace ( '[serverCertificate]' , 'com/hazelcast/nio/ssl/letsencrypt.jks' ) ;
71- serverConfig = serverConfig . replace ( '[password]' , '123456' ) ;
72- return createCluster ( ) . then ( function ( ) {
71+ var sConfig = serverConfig
72+ . replace ( '[serverCertificate]' , 'com/hazelcast/nio/ssl/letsencrypt.jks' )
73+ . replace ( '[password]' , '123456' ) ;
74+ return createCluster ( sConfig ) . then ( function ( ) {
7375 var clientConfig = new Config . ClientConfig ( ) ;
7476 clientConfig . networkConfig . sslConfig . enabled = true ;
7577 return HazelcastClient . newHazelcastClient ( clientConfig ) ;
7678 } ) . then ( function ( hazelcastClient ) {
77- client = hazelcastClient
79+ client = hazelcastClient ;
7880 return expect ( client . lifecycleService . isRunning ( ) ) . to . be . true ;
7981 } ) ;
8082 } ) ;
0 commit comments