aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authoradnano <[email protected]>2020-09-27 19:56:33 -0400
committeradnano <[email protected]>2020-09-27 19:56:33 -0400
commit73e4ef068935c7116c13bd01a9c891fafc19fd79 (patch)
tree4ee890460e7ca39efdb958648b7908950fb815a5 /examples
parentPolish example client (diff)
downloadgo-gemini-73e4ef068935c7116c13bd01a9c891fafc19fd79.tar.xz
go-gemini-73e4ef068935c7116c13bd01a9c891fafc19fd79.zip
Reject invalid status codes
Diffstat (limited to 'examples')
-rw-r--r--examples/auth/auth.go1
-rw-r--r--examples/client/client.go2
-rw-r--r--examples/server/server.go1
3 files changed, 3 insertions, 1 deletions
diff --git a/examples/auth/auth.go b/examples/auth/auth.go
index f135c48..0c99535 100644
--- a/examples/auth/auth.go
+++ b/examples/auth/auth.go
@@ -38,6 +38,7 @@ func main() {
// To generate a TLS key pair, run:
//
// go run -tags=example ../cert
+ //
cert, err := tls.LoadX509KeyPair("examples/client/localhost.crt", "examples/client/localhost.key")
if err != nil {
log.Fatal(err)
diff --git a/examples/client/client.go b/examples/client/client.go
index 402e8f6..30a0a9b 100644
--- a/examples/client/client.go
+++ b/examples/client/client.go
@@ -28,7 +28,7 @@ func init() {
// Alert the user that the 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:
+ case gemini.ErrUnknownCertificate:
// Prompt the user to trust the certificate
trust := trustCertificate(cert)
switch trust {
diff --git a/examples/server/server.go b/examples/server/server.go
index bda87e6..e761cd0 100644
--- a/examples/server/server.go
+++ b/examples/server/server.go
@@ -14,6 +14,7 @@ func main() {
// To generate a TLS key pair, run:
//
// go run -tags=example ../cert
+ //
cert, err := tls.LoadX509KeyPair("examples/server/localhost.crt", "examples/server/localhost.key")
if err != nil {
log.Fatal(err)