File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,12 @@ def create_context(options)
87
87
context . cert = OpenSSL ::X509 ::Certificate . new ( File . open ( options [ :ssl_cert ] ) )
88
88
end
89
89
if options [ :ssl_key ]
90
- context . key = OpenSSL ::PKey ::RSA . new ( File . open ( options [ :ssl_key ] ) )
90
+ if options [ :ssl_key_pass_phrase ]
91
+ context . key = OpenSSL ::PKey ::RSA . new ( File . open ( options [ :ssl_key ] ) ,
92
+ options [ :ssl_key_pass_phrase ] )
93
+ else
94
+ context . key = OpenSSL ::PKey ::RSA . new ( File . open ( options [ :ssl_key ] ) )
95
+ end
91
96
end
92
97
if options [ :ssl_verify ] || options [ :ssl_ca_cert ]
93
98
context . ca_file = options [ :ssl_ca_cert ]
Original file line number Diff line number Diff line change 271
271
272
272
context 'when ssl options are provided' do
273
273
274
+ let ( :ssl_options ) do
275
+ { :ssl => true , :ssl_key => 'file' , :ssl_key_pass_phrase => 'iamaphrase' }
276
+ end
277
+
274
278
let ( :connection ) do
275
- described_class . new ( server , :ssl => true )
279
+ described_class . new ( server , ssl_options )
276
280
end
277
281
278
282
it 'sets the ssl options' do
279
- expect ( connection . send ( :ssl_options ) ) . to eq ( :ssl => true )
283
+ expect ( connection . send ( :ssl_options ) ) . to eq ( ssl_options )
280
284
end
281
285
end
282
286
You can’t perform that action at this time.
0 commit comments