@@ -60,6 +60,7 @@ describe('TLS connection tests', function () {
6060 tls : tls_options
6161 } ) ;
6262 var time = 0 ;
63+ assert . strictEqual ( client . address , '127.0.0.1:' + tls_port ) ;
6364
6465 client . once ( 'ready' , function ( ) {
6566 helper . killConnection ( client ) ;
@@ -87,18 +88,20 @@ describe('TLS connection tests', function () {
8788
8889 describe ( 'when not connected' , function ( ) {
8990
90- it ( 'connect with host and port provided in the options object' , function ( done ) {
91+ it ( 'connect with host and port provided in the tls object' , function ( done ) {
9192 if ( skip ) this . skip ( ) ;
93+ var tls = utils . clone ( tls_options ) ;
94+ tls . port = tls_port ;
95+ tls . host = 'localhost' ;
9296 client = redis . createClient ( {
93- host : 'localhost' ,
9497 connect_timeout : 1000 ,
95- port : tls_port ,
96- tls : tls_options
98+ tls : tls
9799 } ) ;
98100
99101 // verify connection is using TCP, not UNIX socket
100102 assert . strictEqual ( client . connection_options . host , 'localhost' ) ;
101103 assert . strictEqual ( client . connection_options . port , tls_port ) ;
104+ assert . strictEqual ( client . address , 'localhost:' + tls_port ) ;
102105 assert ( client . stream . encrypted ) ;
103106
104107 client . set ( 'foo' , 'bar' ) ;
@@ -115,6 +118,7 @@ describe('TLS connection tests', function () {
115118 port : tls_port ,
116119 tls : faulty_cert
117120 } ) ;
121+ assert . strictEqual ( client . address , 'localhost:' + tls_port ) ;
118122 client . on ( 'error' , function ( err ) {
119123 assert ( / D E P T H _ Z E R O _ S E L F _ S I G N E D _ C E R T / . test ( err . code || err . message ) , err ) ;
120124 client . end ( true ) ;
0 commit comments