From 03c6dd5edc80dd51ca5fb5055dd20f25f93736cc Mon Sep 17 00:00:00 2001 From: Marcel Schneider Date: Wed, 27 Jun 2018 11:14:28 +0200 Subject: [PATCH] Ignore invalid TLS Certificates --- server/server.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/server/server.go b/server/server.go index 8419c5e..b167422 100644 --- a/server/server.go +++ b/server/server.go @@ -1,9 +1,11 @@ package main import ( + "crypto/tls" "encoding/json" "fmt" "io/ioutil" + "net/http" "os" "regexp" "strings" @@ -84,7 +86,13 @@ func operate(mensa string, day int) (Menu, error) { push = 1 } - document, err := goquery.NewDocument(fmt.Sprintf("http://www.studentenwerk-goettingen.de/speiseplan.html?no_cache=1&day=%v&push=%v&selectmensa=%s", day, push, mensa)) + http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true} + res, err := http.Get(fmt.Sprintf("http://www.studentenwerk-goettingen.de/speiseplan.html?no_cache=1&day=%v&push=%v&selectmensa=%s", day, push, mensa)) + if err != nil { + fmt.Println(err) + } + + document, err := goquery.NewDocumentFromResponse(res) if err != nil { return Menu{}, err