cert_handling

package
v0.0.0-...-0b9ac6e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2019 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoticeColor  = "\033[1;36m%s\033[0m"
	WarningColor = "\033[1;33m%s\033[0m"
	ErrorColor   = "\033[1;31m%s\033[0m"
)

Variables

View Source
var Dialer = &net.Dialer{Timeout: 7 * time.Second}

Functions

func DaysLeft

func DaysLeft(givenDate time.Time) (daysLeft int)

Given a time.Time date, return the number of days difference between that and today.

func OutputCertificateValidityReport

func OutputCertificateValidityReport(givenFilename string, warningThreshold int)

given a filename (text file of all domains) and a threshold, output a certificate validity report to screen.

func PrintResult

func PrintResult(givenResult LookupResult, givenThreshold int)

Given a LookupResult object print the result to the screen

func ReadFile

func ReadFile(filename string) (lines []string, err error)

Given a filename, return a slice of strings of all the lines.

Types

type LookupResult

type LookupResult struct {
	Hostname string
	Port     int
	DaysLeft int
	Expiry   time.Time
	Err      error
}

func DoLookup

func DoLookup(givenHostname string, givenPort int) LookupResult

Given a hostname and port combo do a TLS connection and return a LookupResult struct with the results of the query

func DoLookupForString

func DoLookupForString(givenString string) (processThis bool, result LookupResult)

Given a string, parse the URL and do lookups for string processThis - if true this means that the result was successful otherwise you should ignore

func DoLookupsForFile

func DoLookupsForFile(givenFilename string) (results []LookupResult)

Given a filename of domains, parse URLs and do lookups for everything - return a slice of results.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL