Implement Client connection timeout

This commit is contained in:
Adnan Maolood
2020-10-31 20:55:56 -04:00
parent a2fc1772bf
commit 42c95f8c8d
2 changed files with 23 additions and 1 deletions

View File

@@ -20,6 +20,7 @@ var (
)
func init() {
client.Timeout = 2 * time.Minute
client.KnownHosts.LoadDefault()
client.TrustCertificate = func(hostname string, cert *x509.Certificate, knownHosts *gemini.KnownHosts) error {
err := knownHosts.Lookup(hostname, cert)