lib/casclient/client.rb
def cas_server_is_up?
      uri = URI.parse(login_url)
      
      log.debug "Checking if CAS server at URI '#{uri}' is up..."
      
      https = Net::HTTP.new(uri.host, uri.port)
      https.use_ssl = (uri.scheme == 'https')
      https.verify_mode = (@force_ssl_verification ? OpenSSL::SSL::VERIFY_PEER : OpenSSL::SSL::VERIFY_NONE)
      
      begin
        raw_res = https.start do |conn|
          conn.get("#{uri.path}?#{uri.query}")
        end
      rescue Errno::ECONNREFUSED => e
        log.warn "CAS server did not respond! (#{e.inspect})"
        return false
      end
      
      log.debug "CAS server responded with #{raw_res.inspect}:\n#{raw_res.body}"
      
      return raw_res.kind_of?(Net::HTTPSuccess)
    end
# Returns true if the configured CAS server is up and responding;
# false otherwise.
Returns true if the configured CAS server is up and responding;
false otherwise.
Returns true if the configured CAS server is up and responding ; false otherwise .
def cas_server_is_up?
      uri = URI.parse(login_url)
      log.debug "Checking if CAS server at URI '#{uri}' is up..."
      https = Net::HTTP.new(uri.host, uri.port)
      https.use_ssl = (uri.scheme == 'https')
      https.verify_mode = (@force_ssl_verification ? OpenSSL::SSL::VERIFY_PEER : OpenSSL::SSL::VERIFY_NONE)
      begin
        raw_res = https.start do |conn|
          conn.get("#{uri.path}?#{uri.query}")
        end
      rescue Errno::ECONNREFUSED => e
        log.warn "CAS server did not respond! (#{e.inspect})"
        return false
      end
      log.debug "CAS server responded with #{raw_res.inspect}:\n#{raw_res.body}"
      return raw_res.kind_of?(Net::HTTPSuccess)
    end
def cas_server_is_up? uri = URI . parse ( login_url ) log . debug "Checking if CAS server at URI '#{uri}' is up..." https = Net :: HTTP . new ( uri . host , uri . port ) https . use_ssl = ( uri . scheme == 'https' ) https . verify_mode = ( @force_ssl_verification ? OpenSSL :: SSL :: VERIFY_PEER : OpenSSL :: SSL :: VERIFY_NONE ) begin raw_res = https . start do | conn | conn . get ( "#{uri.path}?#{uri.query}" ) end rescue Errno :: ECONNREFUSED => e log . warn "CAS server did not respond! (#{e.inspect})" return false end log . debug "CAS server responded with #{raw_res.inspect}:\n#{raw_res.body}" return raw_res . kind_of? ( Net :: HTTPSuccess ) end
Returns true if the configured CAS server is up and responding;
false otherwise.
Returns true if the configured CAS server is up and responding ; false otherwise .