@@ -60,6 +60,7 @@ describe('TLS connection tests', function () {
60
60
tls : tls_options
61
61
} ) ;
62
62
var time = 0 ;
63
+ assert . strictEqual ( client . address , '127.0.0.1:' + tls_port ) ;
63
64
64
65
client . once ( 'ready' , function ( ) {
65
66
helper . killConnection ( client ) ;
@@ -87,18 +88,20 @@ describe('TLS connection tests', function () {
87
88
88
89
describe ( 'when not connected' , function ( ) {
89
90
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 ) {
91
92
if ( skip ) this . skip ( ) ;
93
+ var tls = utils . clone ( tls_options ) ;
94
+ tls . port = tls_port ;
95
+ tls . host = 'localhost' ;
92
96
client = redis . createClient ( {
93
- host : 'localhost' ,
94
97
connect_timeout : 1000 ,
95
- port : tls_port ,
96
- tls : tls_options
98
+ tls : tls
97
99
} ) ;
98
100
99
101
// verify connection is using TCP, not UNIX socket
100
102
assert . strictEqual ( client . connection_options . host , 'localhost' ) ;
101
103
assert . strictEqual ( client . connection_options . port , tls_port ) ;
104
+ assert . strictEqual ( client . address , 'localhost:' + tls_port ) ;
102
105
assert ( client . stream . encrypted ) ;
103
106
104
107
client . set ( 'foo' , 'bar' ) ;
@@ -115,6 +118,7 @@ describe('TLS connection tests', function () {
115
118
port : tls_port ,
116
119
tls : faulty_cert
117
120
} ) ;
121
+ assert . strictEqual ( client . address , 'localhost:' + tls_port ) ;
118
122
client . on ( 'error' , function ( err ) {
119
123
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 ) ;
120
124
client . end ( true ) ;
0 commit comments