aboutsummaryrefslogtreecommitdiff
path: root/examples/client
diff options
context:
space:
mode:
authoradnano <[email protected]>2020-09-27 16:21:56 -0400
committeradnano <[email protected]>2020-09-27 16:21:56 -0400
commitc79a1f44842500ac48fb65edd92bc27c6fa75c49 (patch)
tree90b09fe231b3bfd117bc0a1826b101dabbbde7e7 /examples/client
parentMake TrustCertificate accept hostname instead of request (diff)
downloadgo-gemini-c79a1f44842500ac48fb65edd92bc27c6fa75c49.tar.xz
go-gemini-c79a1f44842500ac48fb65edd92bc27c6fa75c49.zip
Update documentation
Diffstat (limited to 'examples/client')
-rw-r--r--examples/client/client.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/client/client.go b/examples/client/client.go
index 5b853de..5c1c104 100644
--- a/examples/client/client.go
+++ b/examples/client/client.go
@@ -28,7 +28,7 @@ func init() {
switch err {
case gemini.ErrCertificateNotTrusted:
// Alert the user that the certificate is not trusted
- fmt.Println("error: certificate is not trusted!")
+ fmt.Printf("Warning: certificate for %s is not trusted!\n", hostname)
fmt.Println("This could indicate a Man-in-the-Middle attack.")
case gemini.ErrCertificateUnknown:
// Prompt the user to trust the certificate
@@ -45,6 +45,10 @@ func init() {
return err
}
+ client.GetCertificate = func(req *gemini.Request, store *gemini.CertificateStore) *tls.Certificate {
+ return &cert
+ }
+
// Configure a client side certificate.
// To generate a TLS key pair, run:
//