in debug mode, disable https checking
Ted Unangst tedu@tedunangst.com
Wed, 13 May 2020 17:00:34 -0400
3 files changed,
13 insertions(+),
1 deletions(-)
M
activity.go
→
activity.go
@@ -18,6 +18,7 @@
import ( "bytes" "context" + "crypto/tls" "database/sql" "fmt" "html"@@ -56,12 +57,23 @@ }
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 { return PostMsg(keyname, key, url, j.ToBytes()) } func PostMsg(keyname string, key httpsig.PrivateKey, url string, msg []byte) error { client := http.DefaultClient + if debugMode { + client = debugClient + } req, err := http.NewRequest("POST", url, bytes.NewReader(msg)) if err != nil { return err