Browse Source

Ignore invalid TLS Certificates

master
Schneider 7 years ago
parent
commit
03c6dd5edc
  1. 10
      server/server.go

10
server/server.go

@ -1,9 +1,11 @@
package main package main
import ( import (
"crypto/tls"
"encoding/json" "encoding/json"
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"net/http"
"os" "os"
"regexp" "regexp"
"strings" "strings"
@ -84,7 +86,13 @@ func operate(mensa string, day int) (Menu, error) {
push = 1 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 { if err != nil {
return Menu{}, err return Menu{}, err

Loading…
Cancel
Save