Reject invalid status codes

This commit is contained in:
adnano
2020-09-27 19:56:33 -04:00
parent 9f1a38a0dd
commit 73e4ef0689
5 changed files with 21 additions and 12 deletions

View File

@@ -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)

View File

@@ -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 {

View File

@@ -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)