Ignoring SSL cert issues when importing a site. Fixes #200

pull/207/head
Jordan Wright 2016-03-09 18:55:39 -06:00
parent 9d5f8d640f
commit 219d546a8d
1 changed files with 8 additions and 1 deletions

View File

@ -1,6 +1,7 @@
package controllers
import (
"crypto/tls"
"encoding/json"
"errors"
"fmt"
@ -477,7 +478,13 @@ func API_Import_Site(w http.ResponseWriter, r *http.Request) {
JSONResponse(w, models.Response{Success: false, Message: err.Error()}, http.StatusBadRequest)
return
}
resp, err := http.Get(cr.URL)
tr := &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true,
},
}
client := &http.Client{Transport: tr}
resp, err := client.Get(cr.URL)
if err != nil {
JSONResponse(w, models.Response{Success: false, Message: err.Error()}, http.StatusBadRequest)
return