From f38bcf0bdcfe6a63f645725f2cde811cadb3c07a Mon Sep 17 00:00:00 2001 From: Pouyan Azari Date: Wed, 10 Jul 2019 10:24:59 +0200 Subject: [PATCH] Dont allow browser to open insecure pages --- CHANGELOG | 4 ++++ collector.go | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 969dbd6..b1657b9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,9 @@ # Change Log +## [0.0.7] 2019-07-10 + +- Dont Allow the browser to open insecure pages. + ## [0.0.6] 2019-07-09 - Remove the panic from the navigation part diff --git a/collector.go b/collector.go index 4a4fd9a..ce00567 100644 --- a/collector.go +++ b/collector.go @@ -59,9 +59,16 @@ func getChromeOptions() agouti.Option { }) } +/// getChromeExcludedOptions Returns the excluded options +func getChromeExcludedOptions() agouti.Option { + return agouti.ChromeOptions("excludeSwitches", []string{ + "ignore-certificate-errors", + }) +} + ///startDriver Starts the given driver on the machine func startDriver() *agouti.WebDriver { - driver := agouti.ChromeDriver(getChromeOptions()) + driver := agouti.ChromeDriver(getChromeOptions(), getChromeExcludedOptions(), agouti.RejectInvalidSSL) if err := driver.Start(); err != nil { logger.WithFields( log.Fields{ @@ -479,7 +486,6 @@ func getStatus(config SingleLoginConfig) (status bool, elapsed float64) { } end := time.Now() elapsed = end.Sub(start).Seconds() - // logout if the value is set if config.LogoutXpath != "" { logOut(page, config.LogoutXpath, config.SubmitType)