Add `--no-tls-verify` command line flag.

http_upload
Martin Dosch 4 years ago
parent 2cec0711fb
commit f06dff7321

@ -40,8 +40,7 @@ If no configuration file is present or if the values should be overridden it is
account details via command line options:
```plain
./go-sendxmpp --help
Usage: go-sendxmpp [-cdtx] [-f value] [--help] [-j value] [-p value] [-r value] [-u value] [parameters ...]
Usage: go-sendxmpp [-cdintx] [-f value] [--help] [-j value] [-m value] [-p value] [-r value] [-u value] [parameters ...]
-c, --chatroom Send message to a chatroom.
-d, --debug Show debugging info.
-f, --file=value Set configuration file. (Default: ~/.sendxmpprc)
@ -51,16 +50,17 @@ Usage: go-sendxmpp [-cdtx] [-f value] [--help] [-j value] [-p value] [-r value]
XMPP server address.
-m, --message=value
Set file including the message.
-n, --no-tls-verify
Skip verification of TLS certificates (not recommended).
-p, --password=value
Password for XMPP account.
-r, --resource=value
Set resource. When sending to a chatroom this is used as
'alias'. (Default: go-sendxmpp)
'alias'. (Default: go-sendxmpp) [go-sendxmpp]
-t, --tls Use TLS.
-u, --username=value
Username for XMPP account.
-x, --start-tls Use StartTLS.
```
### examples

@ -179,6 +179,8 @@ func main() {
flagFile := getopt.StringLong("file", 'f', "", "Set configuration file. (Default: ~/.sendxmpprc)")
flagMessageFile := getopt.StringLong("message", 'm', "", "Set file including the message.")
flagInteractive := getopt.BoolLong("interactive", 'i', "Interactive mode (for use with e.g. 'tail -f').")
flagSkipVerify := getopt.BoolLong("no-tls-verify", 'n',
"Skip verification of TLS certificates (not recommended).")
// Parse command line flags.
getopt.Parse()
@ -244,6 +246,7 @@ func main() {
var tlsConfig tls.Config
tlsConfig.ServerName = strings.Split(server, ":")[0]
tlsConfig.NextProtos = append(tlsConfig.NextProtos, "xmpp-client")
tlsConfig.InsecureSkipVerify = *flagSkipVerify
// Set XMPP connection options.
options := xmpp.Options{

@ -4,7 +4,7 @@
.SH "NAME"
\fBgo\-sendxmpp\fR \- A little tool to send messages to an XMPP contact or MUC\.
.SH "SYNOPSIS"
\fBgo\-sendxmpp\fR [\-cdtx] [\-f value] [\-\-help] [\-j value] [\-p value] [\-r value] [\-u value] [parameters \|\.\|\.\|\.]
\fBgo\-sendxmpp\fR [\-cdintx] [\-f value] [\-\-help] [\-j value] [\-m value] [\-p value] [\-r value] [\-u value] [parameters \|\.\|\.\|\.]
.SH "DESCRIPTION"
A little tool to send messages to an XMPP contact or MUC inspired by (but not as powerful as) \fBsendxmpp\fR\.
.br
@ -34,6 +34,9 @@ XMPP server address\.
\fB\-m\fR, \fB\-\-message\fR=[\fIvalue\fR]
Set file including the message\.
.TP
\fB\-n\fR, \fB\-\-no\-tls\-verify\fR
Skip verification of TLS certificates (not recommended)\.
.TP
\fB\-p\fR, \fB\-\-password\fR=[\fIvalue\fR]
Password for XMPP account\.
.TP

@ -77,7 +77,7 @@
</p>
<h2 id="SYNOPSIS">SYNOPSIS</h2>
<p><code>go-sendxmpp</code> [-cdtx] [-f value] [--help] [-j value] [-p value] [-r value] [-u value] [parameters ...]</p>
<p><code>go-sendxmpp</code> [-cdintx] [-f value] [--help] [-j value] [-m value] [-p value] [-r value] [-u value] [parameters ...]</p>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
@ -111,6 +111,10 @@ The account data is expected at <code>~/.sendxmpprc</code> if no other configura
<code>-m</code>, <code>--message</code>=[<var>value</var>]</dt>
<dd>Set file including the message.</dd>
<dt>
<code>-n</code>, <code>--no-tls-verify</code>
</dt>
<dd>Skip verification of TLS certificates (not recommended).</dd>
<dt>
<code>-p</code>, <code>--password</code>=[<var>value</var>]</dt>
<dd>Password for XMPP account.</dd>
<dt>

@ -3,7 +3,7 @@ go-sendxmpp(1) -- A little tool to send messages to an XMPP contact or MUC.
## SYNOPSIS
`go-sendxmpp` [-cdtx] [-f value] [--help] [-j value] [-p value] [-r value] [-u value] [parameters ...]
`go-sendxmpp` [-cdintx] [-f value] [--help] [-j value] [-m value] [-p value] [-r value] [-u value] [parameters ...]
## DESCRIPTION
@ -34,6 +34,9 @@ XMPP server address.
* `-m`, `--message`=[<value>]:
Set file including the message.
* `-n`, `--no-tls-verify`:
Skip verification of TLS certificates (not recommended).
* `-p`, `--password`=[<value>]:
Password for XMPP account.

Loading…
Cancel
Save