Refactor TOFU

This commit is contained in:
adnano
2020-09-25 23:06:54 -04:00
parent b4295dd2dc
commit 927dfd29c5
5 changed files with 124 additions and 80 deletions

View File

@@ -14,8 +14,8 @@ import (
)
var (
client = &gemini.TOFUClient{
Trusts: func(cert *x509.Certificate, req *gemini.Request) bool {
client = &gemini.Client{
TrustCertificate: func(cert *x509.Certificate, knownHosts *gemini.KnownHosts) bool {
// Trust all certificates
return true
},
@@ -45,7 +45,7 @@ func makeRequest(url string) {
}
req.Certificate = cert
resp, err := gemini.Send(client, req)
resp, err := client.Send(req)
if err != nil {
log.Fatal(err)
}