File tree Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,11 @@ def timeout
82
82
83
83
private
84
84
85
- attr_reader :socket , :ssl_options
85
+ attr_reader :socket
86
+
87
+ def ssl_options
88
+ @ssl_options [ :ssl ] == true ? @ssl_options : { }
89
+ end
86
90
87
91
def ensure_connected
88
92
ensure_same_process!
Original file line number Diff line number Diff line change 284
284
end
285
285
end
286
286
287
+ context 'when ssl is false' do
288
+
289
+ context 'when ssl options are provided' do
290
+
291
+ let ( :ssl_options ) do
292
+ { :ssl => false , :ssl_key => 'file' , :ssl_key_pass_phrase => 'iamaphrase' }
293
+ end
294
+
295
+ let ( :connection ) do
296
+ described_class . new ( server , ssl_options )
297
+ end
298
+
299
+ it 'does not set the ssl options' do
300
+ expect ( connection . send ( :ssl_options ) ) . to be_empty
301
+ end
302
+ end
303
+
304
+ context 'when ssl options are not provided' do
305
+
306
+ let ( :ssl_options ) do
307
+ { :ssl => false }
308
+ end
309
+
310
+ let ( :connection ) do
311
+ described_class . new ( server , ssl_options )
312
+ end
313
+
314
+ it 'does not set the ssl options' do
315
+ expect ( connection . send ( :ssl_options ) ) . to be_empty
316
+ end
317
+ end
318
+ end
319
+
287
320
context 'when authentication options are provided' do
288
321
289
322
let ( :connection ) do
You can’t perform that action at this time.
0 commit comments