lib/wmap/host_tracker/primary_host.rb
# Procedures to identify primary host-name from the site store SSL certificates. The assumption is that the CN used in the cert application must be primary hostname and used by the users.
Procedures to identify primary host-name from the site store SSL certificates. The assumption is that the CN used in the cert application must be primary hostname and used by the users.
Procedures to identify primary host - name from the site store SSL certificates . The assumption is that the CN used in the cert application must be primary hostname and used by the users .
def update_from_site_store!
        puts "Invoke internal procedures to update the primary host-name table from the site store."
				cns=Hash.new
				checker=Wmap::UrlChecker.new(:data_dir=>@data_dir)
        my_tracker = Wmap::SiteTracker.instance
        my_tracker.sites_file = @data_dir + "sites"
        my_tracker.load_site_stores_from_file
				my_tracker.get_ssl_sites.map do |site|
					puts "Exam SSL enabled site entry #{site} ..."
					my_host=url_2_host(site)
					next if @known_hosts.key?(my_host) 
					puts "Pull SSL cert details on site: #{site}"
					cn=checker.get_cert_cn(site)
					unless cn.nil? or cns.key?(cn)
						cns[cn]=true
					end
				end
				cns.keys.map do |cn|
					if is_fqdn?(cn)
						next if @known_hosts.key?(cn)
						self.add(cn)
						puts "New entry added: #{cn}\t#{@known_hosts[cn]}"
					end
				end
				self.save!
        checker=nil
        my_tracker=nil
		end
def update_from_site_store! puts "Invoke internal procedures to update the primary host-name table from the site store." cns = Hash . new checker = Wmap :: UrlChecker . new ( :data_dir => @data_dir ) my_tracker = Wmap :: SiteTracker . instance my_tracker . sites_file = @data_dir + "sites" my_tracker . load_site_stores_from_file my_tracker . get_ssl_sites . map do | site | puts "Exam SSL enabled site entry #{site} ..." my_host = url_2_host ( site ) next if @known_hosts . key? ( my_host ) puts "Pull SSL cert details on site: #{site}" cn = checker . get_cert_cn ( site ) unless cn . nil? or cns . key? ( cn ) cns [ cn ] = true end end cns . keys . map do | cn | if is_fqdn? ( cn ) next if @known_hosts . key? ( cn ) self . add ( cn ) puts "New entry added: #{cn}\t#{@known_hosts[cn]}" end end self . save! checker = nil my_tracker = nil end
Procedures to identify primary host-name from the site store SSL certificates.
Procedures to identify primary host - name from the site store SSL certificates .
#begin # Step 1 - update the prime host table based on the SSL cert CN fields # add the logic to optimize the process # Step 2 - Save the cache into the file #rescue Exception => ee #	puts "Exception on method #{__method__}: #{ee}" if @verbose #  checker=nil #  my_tracker=nil #	return nil #end