|
|
|
@ -238,6 +238,8 @@ func main() {
|
|
|
|
|
flagRaw := getopt.BoolLong("raw", 0, "Send raw XML.")
|
|
|
|
|
flagListen := getopt.BoolLong("listen", 'l', "Listen for messages and print them to stdout.")
|
|
|
|
|
flagTimeout := getopt.IntLong("timeout", 0, 10, "Connection timeout in seconds.")
|
|
|
|
|
flagTLSMinVersion := getopt.IntLong("tls-version", 0, 12,
|
|
|
|
|
"Minimal TLS version. 10 (TSLv1.0), 11 (TLSv1.1), 12 (TLSv1.2) or 13 (TLSv1.3).")
|
|
|
|
|
|
|
|
|
|
// Parse command line flags.
|
|
|
|
|
getopt.Parse()
|
|
|
|
@ -325,6 +327,19 @@ func main() {
|
|
|
|
|
tlsConfig.ServerName = user[strings.Index(user, "@")+1:]
|
|
|
|
|
tlsConfig.NextProtos = append(tlsConfig.NextProtos, "xmpp-client")
|
|
|
|
|
tlsConfig.InsecureSkipVerify = *flagSkipVerify
|
|
|
|
|
switch *flagTLSMinVersion {
|
|
|
|
|
case 10:
|
|
|
|
|
tlsConfig.MinVersion = tls.VersionTLS10
|
|
|
|
|
case 11:
|
|
|
|
|
tlsConfig.MinVersion = tls.VersionTLS11
|
|
|
|
|
case 12:
|
|
|
|
|
tlsConfig.MinVersion = tls.VersionTLS12
|
|
|
|
|
case 13:
|
|
|
|
|
tlsConfig.MinVersion = tls.VersionTLS13
|
|
|
|
|
default:
|
|
|
|
|
fmt.Println("Unknown TLS version.")
|
|
|
|
|
os.Exit(0)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set XMPP connection options.
|
|
|
|
|
options := xmpp.Options{
|
|
|
|
|