File tree 2 files changed +12
-3
lines changed
2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,12 @@ def create_context(options)
104
104
context . cert = OpenSSL ::X509 ::Certificate . new ( File . open ( options [ :ssl_cert ] ) )
105
105
end
106
106
if options [ :ssl_key ]
107
- context . key = OpenSSL ::PKey ::RSA . new ( File . open ( options [ :ssl_key ] ) )
107
+ if options [ :ssl_key_pass_phrase ]
108
+ context . key = OpenSSL ::PKey ::RSA . new ( File . open ( options [ :ssl_key ] ) ,
109
+ options [ :ssl_key_pass_phrase ] )
110
+ else
111
+ context . key = OpenSSL ::PKey ::RSA . new ( File . open ( options [ :ssl_key ] ) )
112
+ end
108
113
end
109
114
if options [ :ssl_verify ] || options [ :ssl_ca_cert ]
110
115
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