Browse Source

Ignore invalid TLS Certificates

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

10
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

Loading…
Cancel
Save