Reject invalid status codes
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user