fix cert verification in delicious calls

fixes #6383

testplan: add delicious to your user profile in three cases:
 * /etc/ssl/certs doesn't exist
 * /etc/ssl/certs exists but doesn't include the root CA for https://api.del.icio.us
 * /etc/ssl/certs exist and includes the CA
 In the first and last cases, canvas should be able to request your delicious profile successfully. In the second case, it should fail.

Change-Id: If2f4e3f7b534bd05236e50f068472e2b7baf2c9c
Reviewed-on: https://gerrit.instructure.com/7033
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
This commit is contained in:
Brian Palmer 2011-11-17 09:33:31 -07:00
parent 0369527db4
commit f55f736638
1 changed files with 4 additions and 4 deletions

View File

@ -22,13 +22,13 @@ module DeliciousDiigo
require 'uri'
def delicious_generate_request(url, method, user_name, password)
rootCA = 'etc/ssl/certs'
rootCA = '/etc/ssl/certs'
url = URI.parse url
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = (url.scheme == 'https')
if File.exist? rootCA
http.ca_file = rootCA
if File.directory? rootCA
http.ca_path = rootCA
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
http.verify_depth = 5
else
@ -153,4 +153,4 @@ module DeliciousDiigo
response.error!
end
end
end
end