vmware-archive / vcloud-rest

Unofficial ruby bindings for VMware vCloud Director®
Apache License 2.0
29 stars 37 forks source link

Added an optional parameter to manage ciphers list to the Connection#initializer #52

Open monical75 opened 5 years ago

monical75 commented 5 years ago

When I try to connect to vcloud I run into "SSL_connect returned=1 errno=0 state=error: dh key too small (OpenSSL::SSL::SSLError)" error The problem is due to the different versions of SSL between client and server. As suggested in this article https://zackhobson.com/2014/02/10/ssl_and_ruby_part_2/, it's enough providing the ciphers list in the connection.

So I solved this problem by adding an optional parameter to the Connection#initliaze

initialize(host, username, password, org_name, api_version, opts={})

Then I use this new paramter in setup_request(params, payload=nil, content_type=nil)

unless @opts.empty? req_params.merge!({ssl_ciphers: @opts[:ssl_ciphers] }) if @opts[:ssl_ciphers] end

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.06%) to 71.392% when pulling 04179f6f0079f2064e3efbaa9971bbd4bbecb9e8 on monical75:master into 45425d93acf988946cac375b803100ad01206459 on vmware:master.