summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@gmail.com>2020-02-14 09:28:22 +0100
committerBenjamin Franzke <benjaminfranzke@gmail.com>2020-02-14 18:27:47 +0100
commit2606a7ef6d4588a065b24cda2bfbdd859803d66b (patch)
tree655706310f9f1146fde60ceaef4b5769071f2b00
parente73db5681823d69fa445e087f48f440df14e267b (diff)
downloadcmumble-2606a7ef6d4588a065b24cda2bfbdd859803d66b.tar.gz
cmumble-2606a7ef6d4588a065b24cda2bfbdd859803d66b.tar.bz2
cmumble-2606a7ef6d4588a065b24cda2bfbdd859803d66b.zip
WIP Require valid TLS certificate
-rw-r--r--src/connection.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/connection.c b/src/connection.c
index 0369ba1..abe6ca5 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -28,7 +28,7 @@ connection_ready(GObject *source_object, GAsyncResult *res, gpointer user_data)
con->conn = g_socket_client_connect_to_host_finish (con->sock_client,
res, &error);
if (error) {
- g_printerr("connect failed: %s\n", error->message);
+ g_printerr("connect failed[%d]: %s\n", error->code, error->message);
g_main_loop_quit(cm->loop);
g_error_free(error);
return;
@@ -60,8 +60,12 @@ cmumble_connection_init(struct cmumble *cm,
con->sock_client = g_socket_client_new();
g_socket_client_set_tls(con->sock_client, TRUE);
+ /*
g_socket_client_set_tls_validation_flags(con->sock_client,
G_TLS_CERTIFICATE_INSECURE);
+ */
+ g_socket_client_set_tls_validation_flags(con->sock_client,
+ G_TLS_CERTIFICATE_VALIDATE_ALL);
g_socket_client_set_family(con->sock_client, G_SOCKET_FAMILY_IPV4);
g_socket_client_set_protocol(con->sock_client, G_SOCKET_PROTOCOL_TCP);
g_socket_client_set_socket_type(con->sock_client, G_SOCKET_TYPE_STREAM);