prvPath := flag.String("key", "", "Path to client PKCS#8 private key")
casPath := flag.String("ca", "", "Path to CA certificates file")
hostname := flag.String("name", "example.com", "Expected server's hostname")
+ insecure := flag.Bool("insecure", false, "Insecure mode")
fpr := flag.String("fpr", "", "Expected SHA256 hash of server certificate's SPKI")
flag.Usage = func() {
fmt.Fprintf(os.Stderr, `Usage: tcpclient host port tlsc -name expected.name
}
cfg := &tls.Config{}
- if *hostname == "" || *onlyShow {
+ if *hostname == "" || *onlyShow || *insecure {
cfg.InsecureSkipVerify = true
}
if *hostname != "" {