diff --git a/lib/cryptcheck/tls.rb b/lib/cryptcheck/tls.rb index 315d0fc..94a7c4c 100644 --- a/lib/cryptcheck/tls.rb +++ b/lib/cryptcheck/tls.rb @@ -3,6 +3,11 @@ require 'parallel' module CryptCheck module Tls + def self.analyze(hostname, port) + host = Host.new hostname, port + self.aggregate host + end + def self.aggregate(hosts) hosts = [hosts] unless hosts.respond_to? :collect hosts.inject([]) { |l, h| l + h.to_h } diff --git a/lib/cryptcheck/tls/xmpp.rb b/lib/cryptcheck/tls/xmpp.rb index 439fc7b..3f2f56f 100644 --- a/lib/cryptcheck/tls/xmpp.rb +++ b/lib/cryptcheck/tls/xmpp.rb @@ -17,8 +17,7 @@ module CryptCheck srv.collect { |s| [s.target.to_s, s.port] } end - hosts.collect { |args| Host.new *args, domain: hostname } - p hosts + Tls.aggregate hosts.collect { |args| Host.new *args, domain: hostname } end end end diff --git a/lib/cryptcheck/tls/xmpp/host.rb b/lib/cryptcheck/tls/xmpp/host.rb index c3bb8bc..2ff2421 100644 --- a/lib/cryptcheck/tls/xmpp/host.rb +++ b/lib/cryptcheck/tls/xmpp/host.rb @@ -7,8 +7,6 @@ module CryptCheck def initialize(*args, domain: nil, type: :s2s) @domain, @type = domain, type super *args - Logger.info { '' } - Logger.info { self.required? ? 'Required'.colorize(:good) : 'Not required'.colorize(:warning) } end private