Skip to content
This repository was archived by the owner on Nov 9, 2020. It is now read-only.

Added an optional parameter to the Connection#initliaze for the SSL #50

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ tmp
Gemfile.lock
.ruby-version
.ruby-gemset
.idea/

# YARD artifacts
.yardoc
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changes

### 2016-06-07 (1.4.1)

**Features**

* Added an optional parameter to the Connection#initliaze for the SSL mode. Useful for testing vCloud Director in a lab environment when a real SSL cert is not available.

Normal connection setup:

connection = VCloudClient::Connection.new(host, user, pass, org, api)

Disable SSL certificate check:

connection = VCloudClient::Connection.new(host, user, pass, org, api, OpenSSL::SSL::VERIFY_NONE)

### 2015-06-28 (1.4.0)

Note that I don't have enough time anymore to actively maintain this gem and I'm
Expand Down
5 changes: 3 additions & 2 deletions lib/vcloud-rest/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,15 @@ class Connection
attr_reader :api_url, :auth_key
attr_reader :extensibility

def initialize(host, username, password, org_name, api_version)
def initialize(host, username, password, org_name, api_version, verify_ssl=true)
@host = host
@api_url = "#{host}/api"
@host_url = "#{host}"
@username = username
@password = password
@org_name = org_name
@api_version = (api_version || "5.1")
@verify_ssl = verify_ssl

init_logger
end
Expand Down Expand Up @@ -161,7 +162,7 @@ def parse_error_body(error)
end

def setup_request(params, payload=nil, content_type=nil)
req_params = {:method => params['method'],
req_params = {:method => params['method'], :verify_ssl => @verify_ssl,
:headers => {:accept => "application/*+xml;version=#{@api_version}"},
:url => "#{@api_url}#{params['command']}",
:payload => payload}
Expand Down
2 changes: 1 addition & 1 deletion lib/vcloud-rest/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module VCloudClient
VERSION = "1.4.0"
VERSION = "1.4.1"
end