in debug mode, disable https checking
This commit is contained in:
parent
4721226402
commit
8196f8b53e
12
activity.go
12
activity.go
|
@ -18,6 +18,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
|
"crypto/tls"
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"fmt"
|
"fmt"
|
||||||
"html"
|
"html"
|
||||||
|
@ -56,12 +57,23 @@ func friendorfoe(ct string) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var debugClient = &http.Client{
|
||||||
|
Transport: &http.Transport{
|
||||||
|
TLSClientConfig: &tls.Config{
|
||||||
|
InsecureSkipVerify: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
func PostJunk(keyname string, key httpsig.PrivateKey, url string, j junk.Junk) error {
|
func PostJunk(keyname string, key httpsig.PrivateKey, url string, j junk.Junk) error {
|
||||||
return PostMsg(keyname, key, url, j.ToBytes())
|
return PostMsg(keyname, key, url, j.ToBytes())
|
||||||
}
|
}
|
||||||
|
|
||||||
func PostMsg(keyname string, key httpsig.PrivateKey, url string, msg []byte) error {
|
func PostMsg(keyname string, key httpsig.PrivateKey, url string, msg []byte) error {
|
||||||
client := http.DefaultClient
|
client := http.DefaultClient
|
||||||
|
if debugMode {
|
||||||
|
client = debugClient
|
||||||
|
}
|
||||||
req, err := http.NewRequest("POST", url, bytes.NewReader(msg))
|
req, err := http.NewRequest("POST", url, bytes.NewReader(msg))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
1
honk.go
1
honk.go
|
@ -260,6 +260,7 @@ func main() {
|
||||||
}
|
}
|
||||||
getconfig("usersep", &userSep)
|
getconfig("usersep", &userSep)
|
||||||
getconfig("honksep", &honkSep)
|
getconfig("honksep", &honkSep)
|
||||||
|
getconfig("debug", &debugMode)
|
||||||
prepareStatements(db)
|
prepareStatements(db)
|
||||||
switch cmd {
|
switch cmd {
|
||||||
case "admin":
|
case "admin":
|
||||||
|
|
1
web.go
1
web.go
|
@ -2357,7 +2357,6 @@ func serve() {
|
||||||
go bgmonitor()
|
go bgmonitor()
|
||||||
w100 := wait100ms()
|
w100 := wait100ms()
|
||||||
|
|
||||||
getconfig("debug", &debugMode)
|
|
||||||
readviews = templates.Load(debugMode,
|
readviews = templates.Load(debugMode,
|
||||||
viewDir+"/views/honkpage.html",
|
viewDir+"/views/honkpage.html",
|
||||||
viewDir+"/views/honkfrags.html",
|
viewDir+"/views/honkfrags.html",
|
||||||
|
|
Loading…
Reference in New Issue