what "unknown tls.Config field" Error Means?

huangapple go评论97阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2014年6月8日 20:04:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/24105960.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定