aboutsummaryrefslogtreecommitdiff
path: root/libsylph/ssl.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-12-13 04:33:15 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-12-13 04:33:15 +0000
commit0d93d2a44ee23d371f0e9536635d56109f340c83 (patch)
tree28c828f065c9c279100288fbd18d3aa166658ef2 /libsylph/ssl.c
parentf239571c2ad97975edaceb80845b97c5daa77593 (diff)
read /etc/ssl/certs if exist.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1417 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph/ssl.c')
-rw-r--r--libsylph/ssl.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/libsylph/ssl.c b/libsylph/ssl.c
index 7b3c5c17..80808d1b 100644
--- a/libsylph/ssl.c
+++ b/libsylph/ssl.c
@@ -48,11 +48,25 @@ void ssl_init(void)
certs_dir = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, "certs", NULL);
if (!is_dir_exist(certs_dir)) {
- debug_print("%s doesn't exist, or not a directory.\n",
+ debug_print("ssl_init(): %s doesn't exist, or not a directory.\n",
certs_dir);
g_free(certs_dir);
- certs_dir = NULL;
+#ifdef G_OS_WIN32
+ certs_dir = g_strconcat(get_startup_dir(), G_DIR_SEPARATOR_S
+ "etc" G_DIR_SEPARATOR_S
+ "ssl" G_DIR_SEPARATOR_S "certs", NULL);
+#else
+ certs_dir = g_strdup("/etc/ssl/certs");
+#endif
+ if (!is_dir_exist(certs_dir)) {
+ debug_print("ssl_init(): %s doesn't exist, or not a directory.\n",
+ certs_dir);
+ g_free(certs_dir);
+ certs_dir = NULL;
+ }
}
+ if (certs_dir)
+ debug_print("ssl_init(): certs dir %s found.\n", certs_dir);
ssl_ctx_SSLv23 = SSL_CTX_new(SSLv23_client_method());
if (ssl_ctx_SSLv23 == NULL) {