diff --git a/check_collective-access.rb b/check_collective-access.rb index a55abff..74b90ed 100755 --- a/check_collective-access.rb +++ b/check_collective-access.rb @@ -9,6 +9,7 @@ require 'open-uri' require 'optparse' require 'yaml' +require 'openssl' exit_code = 0 options = {} @@ -55,8 +56,8 @@ def usage(optparse) expected_states = YAML.load(File.read(options[:config])) begin -html_auth = open("https://#{options[:host]}/service.php/auth/login", :http_basic_authentication=>[options[:user], options[:password]]) -html = open("https://#{options[:host]}/index.php/administrate/setup/ConfigurationCheck/DoCheck", "Cookie" => html_auth.meta['set-cookie'].split('; ',2)[0]) +html_auth = open("https://#{options[:host]}/service.php/auth/login", :http_basic_authentication=>[options[:user], options[:password]], :ssl_verify_mode => OpenSSL::SSL::VERIFY_NONE) +html = open("https://#{options[:host]}/index.php/administrate/setup/ConfigurationCheck/DoCheck", "Cookie" => html_auth.meta['set-cookie'][/collectiveaccess=[^;]+/], :ssl_verify_mode => OpenSSL::SSL::VERIFY_NONE) rescue puts 'Unable to log in to the app, it is either misconfigured or the wrong credentials have been provided' exit 3