about summary refs log tree commit diff
path: root/extra/notify/notify.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--extra/notify/notify.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/extra/notify/notify.c b/extra/notify/notify.c
index 7257f4b..935ba26 100644
--- a/extra/notify/notify.c
+++ b/extra/notify/notify.c
@@ -258,14 +258,16 @@ int main(int argc, char *argv[]) {
 	const char *host = NULL;
 	const char *port = "6697";
 	const char *pass = NULL;
+	const char *trust = NULL;
 	const char *user = "pounce-notify";
 
-	for (int opt; 0 < (opt = getopt(argc, argv, "!c:k:p:u:vw:"));) {
+	for (int opt; 0 < (opt = getopt(argc, argv, "!c:k:p:t:u:vw:"));) {
 		switch (opt) {
 			break; case '!': insecure = true;
 			break; case 'c': cert = optarg;
 			break; case 'k': priv = optarg;
 			break; case 'p': port = optarg;
+			break; case 't': trust = optarg;
 			break; case 'u': user = optarg;
 			break; case 'v': verbose = true;
 			break; case 'w': pass = optarg;
@@ -292,6 +294,11 @@ int main(int argc, char *argv[]) {
 	}
 
 	int error;
+	if (trust) {
+		tls_config_insecure_noverifyname(config);
+		error = tls_config_set_ca_file(config, trust);
+		if (error) errx(EX_NOINPUT, "%s: %s", trust, tls_config_error(config));
+	}
 	if (cert) {
 		error = tls_config_set_keypair_file(config, cert, (priv ? priv : cert));
 		if (error) {