dongqiu5184
dongqiu5184
2014-06-08 12:04
浏览 105
已采纳

“未知的tls.Config字段”错误是什么意思?

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

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • douyinbo3361
    douyinbo3361 2014-06-08 12:20
    已采纳

    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

    点赞 评论
  • douduxia1551
    douduxia1551 2014-06-10 07:11

    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.

    点赞 评论

相关推荐