summary refs log tree commit diff
path: root/server.c
diff options
context:
space:
mode:
Diffstat (limited to 'server.c')
-rw-r--r--server.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/server.c b/server.c
index bdeb695..19d5aca 100644
--- a/server.c
+++ b/server.c
@@ -33,13 +33,18 @@ typedef unsigned char byte;
 
 static struct tls *client;
 
-int serverConnect(const char *host, const char *port) {
+int serverConnect(bool insecure, const char *host, const char *port) {
 	int error;
 
 	struct tls_config *config = tls_config_new();
 	error = tls_config_set_ciphers(config, "compat");
 	if (error) errx(EX_SOFTWARE, "tls_config");
 
+	if (insecure) {
+		tls_config_insecure_noverifycert(config);
+		tls_config_insecure_noverifyname(config);
+	}
+
 	client = tls_client();
 	if (!client) errx(EX_SOFTWARE, "tls_client");