class Yawast::Scanner::Plugins::SSL::SSLLabs::Info

Public Class Methods

call_info(endpoint) click to toggle source
# File lib/scanner/plugins/ssl/ssl_labs/info.rb, line 11
def self.call_info(endpoint)
  uri = endpoint.copy
  uri.path = '/api/v3/info'

  body = Yawast::Shared::Http.get uri

  body
end
extract_msg(body) click to toggle source
# File lib/scanner/plugins/ssl/ssl_labs/info.rb, line 20
def self.extract_msg(body)
  ret = []

  begin
    json = JSON.parse body
  rescue => e # rubocop:disable Style/RescueStandardError
    raise Exception, "Invalid response from SSL Labs: '#{e.message}'"
  end

  unless json['messages'].nil?
    json['messages'].each do |msg|
      ret.push msg
    end
  end

  ret
end