diff options
| author | Adnan Maolood <[email protected]> | 2020-10-31 22:45:21 -0400 |
|---|---|---|
| committer | Adnan Maolood <[email protected]> | 2020-10-31 22:45:21 -0400 |
| commit | 8181b86759957ca7f8c67a7102eaa2ca515f05a3 (patch) | |
| tree | fd7c26e3092529d12bf678d734448e5141573266 /examples | |
| parent | Refactor client.TrustCertificate workflow (diff) | |
| download | go-gemini-8181b86759957ca7f8c67a7102eaa2ca515f05a3.tar.xz go-gemini-8181b86759957ca7f8c67a7102eaa2ca515f05a3.zip | |
Add option to skip trust checks
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/client.go | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/examples/client.go b/examples/client.go index 4c9b172..0a35cca 100644 --- a/examples/client.go +++ b/examples/client.go @@ -5,7 +5,6 @@ package main import ( "bufio" "crypto/tls" - "crypto/x509" "fmt" "io/ioutil" "log" @@ -31,19 +30,6 @@ var ( func init() { client.Timeout = 2 * time.Minute - client.KnownHosts.LoadDefault() - client.TrustCertificate = func(hostname string, cert *x509.Certificate) gemini.Trust { - fmt.Printf(trustPrompt, hostname, gemini.Fingerprint(cert)) - scanner.Scan() - switch scanner.Text() { - case "t": - return gemini.TrustAlways - case "o": - return gemini.TrustOnce - default: - return gemini.TrustNone - } - } client.CreateCertificate = func(hostname, path string) (tls.Certificate, error) { fmt.Println("Generating client certificate for", hostname, path) return gemini.CreateCertificate(gemini.CertificateOptions{ |