summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBerke Viktor <bviktor@hexchat.org>2012-11-12 04:06:03 +0100
committerBerke Viktor <bviktor@hexchat.org>2012-11-12 04:06:03 +0100
commit49d5234b39aa491747864efba1c2246c6e960b6f (patch)
tree0a066a688f3f39e2884524feaaf5517ca44c5737
parent40d4c592b353d348b043134d942a9b00ad61d0b9 (diff)
Load own certs from <config>\certs
-rw-r--r--src/common/server.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/server.c b/src/common/server.c
index 360fb2c6..dbfdcdd8 100644
--- a/src/common/server.c
+++ b/src/common/server.c
@@ -1727,14 +1727,14 @@ server_connect (server *serv, char *hostname, int port, int no_login)
 		char *cert_file;
 
 		/* first try network specific cert/key */
-		cert_file = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s.pem",
+		cert_file = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "certs" G_DIR_SEPARATOR_S "%s.pem",
 					 get_xdir (), server_get_network (serv, TRUE));
 		if (SSL_CTX_use_certificate_file (ctx, cert_file, SSL_FILETYPE_PEM) == 1)
 			SSL_CTX_use_PrivateKey_file (ctx, cert_file, SSL_FILETYPE_PEM);
 		else
 		{
-			/* if that doesn't exist, try <xdir>/client.pem */
-			cert_file = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "client.pem", get_xdir ());
+			/* if that doesn't exist, try <config>/certs/client.pem */
+			cert_file = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "certs" G_DIR_SEPARATOR_S "client.pem", get_xdir ());
 			if (SSL_CTX_use_certificate_file (ctx, cert_file, SSL_FILETYPE_PEM) == 1)
 				SSL_CTX_use_PrivateKey_file (ctx, cert_file, SSL_FILETYPE_PEM);
 		}