在 Raspberry Pi 3(基于 ARM,搭载 Rasbian 操作系统)上构建一个向不同服务器发送 HTTP 请求并读取响应的 Go 程序时,遇到了以下错误: * “# golang.org/x/crypto/acme/autocert” * “hello.SupportedProtos undefined” * “hello.SignatureSchemes undefined” * “undefined: tls.SignatureScheme” * “undefined: tls.ECDSAWithP256AndSHA256”
我正在用 go 编写一个程序,它向不同的服务器发出 http 请求并读取响应。该程序在 windows/mac 上运行得非常好,但是当我在带有 rasbian 操作系统的基于 arm 的 rasp pi 3 上运行该程序时,它失败了。
每次我尝试构建代码时都会抛出此错误,有人可以建议我在这里做错了什么吗?
# golang.org/x/crypto/acme/autocert ../../go/src/golang.org/x/crypto/acme/autocert/autocert.go:301: hello.SupportedProtos undefined (type *tls.ClientHelloInfo has no field or method SupportedProtos) ../../go/src/golang.org/x/crypto/acme/autocert/autocert.go:311: hello.SignatureSchemes undefined (type *tls.ClientHelloInfo has no field or method SignatureSchemes) ../../go/src/golang.org/x/crypto/acme/autocert/autocert.go:314: hello.SignatureSchemes undefined (type *tls.ClientHelloInfo has no field or method SignatureSchemes) ../../go/src/golang.org/x/crypto/acme/autocert/autocert.go:315: undefined: tls.SignatureScheme ../../go/src/golang.org/x/crypto/acme/autocert/autocert.go:317: undefined: tls.ECDSAWithP256AndSHA256 ../../go/src/golang.org/x/crypto/acme/autocert/autocert.go:318: undefined: tls.ECDSAWithP384AndSHA384 ../../go/src/golang.org/x/crypto/acme/autocert/autocert.go:318: undefined: tls.ECDSAWithP521AndSHA512 ../../go/src/golang.org/x/crypto/acme/autocert/autocert.go:344: undefined: tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 ../../go/src/golang.org/x/crypto/acme/autocert/autocert.go:347: undefined: tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305
预先感谢您的支持,如果您需要更多信息,请告诉我。
解决方案
确保使用与其他平台相同的 Go 版本。新版本中可能添加了一些功能。
到这里,我们也就讲完了《手臂上的 autocert 缺失字段或方法签名方案》的内容了。个人认为,基础知识的学习和巩固,是为了更好的将其运用到项目中,欢迎关注golang学习网公众号,带你了解更多关于的知识点!
本文内容来源于互联网,如有侵权请联系删除。
