Merge pull request #54 from zbb93/master

#49 - Ignore Invalid SSL Cert
This commit is contained in:
Adam Tauber 2017-02-12 17:51:35 +01:00 committed by GitHub
commit 41c62a88bf
3 changed files with 7 additions and 0 deletions

View File

@ -31,6 +31,7 @@ type Config struct {
type GeneralOptions struct {
Timeout Duration
FormatJSON bool
Insecure bool
PreserveScrollPosition bool
DefaultURLScheme string
}
@ -43,6 +44,7 @@ var DefaultConfig = Config{
defaultTimeoutDuration,
},
FormatJSON: true,
Insecure: false,
PreserveScrollPosition: true,
DefaultURLScheme: "https",
},

View File

@ -4,3 +4,4 @@ timeout = "1m"
defaultURLScheme = "https"
formatJSON = true
preserveScrollPosition = true
insecure = false

View File

@ -21,6 +21,7 @@ import (
"github.com/asciimoo/wuzz/config"
"crypto/tls"
"github.com/jroimartin/gocui"
"github.com/mattn/go-runewidth"
)
@ -920,6 +921,8 @@ func (a *App) ParseArgs(g *gocui.Gui, args []string) error {
if strings.Index(getViewValue(g, "headers"), "Accept-Encoding") == -1 {
fmt.Fprintln(vh, "Accept-Encoding: gzip, deflate")
}
case "--insecure":
a.config.General.Insecure = true
default:
u := args[arg_index]
if strings.Index(u, "http://") != 0 && strings.Index(u, "https://") != 0 {
@ -952,6 +955,7 @@ func (a *App) ParseArgs(g *gocui.Gui, args []string) error {
// args can override the provided config values
func (a *App) InitConfig() {
CLIENT.Timeout = a.config.General.Timeout.Duration
TRANSPORT.TLSClientConfig = &tls.Config{InsecureSkipVerify: a.config.General.Insecure}
}
func initApp(a *App, g *gocui.Gui) {