英文:
what "unknown tls.Config field" Error Means?
问题
在使用"go install"编译Go语言代码时,我遇到了以下错误:
./xyzcheck.go:34: 在结构体字面量中未知的tls.Config字段'EarlyCCS'
这是导致错误的代码:
conn, err = tls.Dial("tcp", target, &tls.Config{InsecureSkipVerify: true, EarlyCCS: 2})
if err == nil {
fmt.Printf("\x1b[31mXYZ Check is OK.\x1b[0m\n")
os.Exit(1)
}
我在谷歌上搜索了这个错误,但没有找到解决方法。
如果有人能告诉我这个错误的原因以及如何修复它,那将非常好。
谢谢。
英文:
While I compile a go language code using "go install", I got the following error:
> ./xyzcheck.go:34: unknown tls.Config field 'EarlyCCS' in struct literal
here is the code that make that error
conn, err = tls.Dial("tcp", target, &tls.Config{InsecureSkipVerify: true, EarlyCCS: 2})
if err == nil {
fmt.Printf("\x1b[31mXYZ Check is OK.\x1b[0m\n")
os.Exit(1)
}
I googled this error but no luck.
If anyone can tell me what is the reason for this error? and how can I fix it. it will be great.
Thanks
答案1
得分: 2
ABC: 2不是config的有效参数。有关tls配置设置的文档在这里:http://golang.org/pkg/crypto/tls/#Config
英文:
ABC: 2 is not a valid parameter for config. There is documentation on config settings for tls here: http://golang.org/pkg/crypto/tls/#Config
答案2
得分: 0
作者有一个需要应用到tls包的补丁。在你获取这个脚本的博客页面上已经清楚地解释了这一点。
将补丁应用到tls包上,重新运行脚本,它就会正常工作。
英文:
The author has a patch that needs to be applied to the tls package. This was clearly explained on his blog page where you obtained this script.
Apply the patch to the tls package, re-run the script and it will work.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论