]> git.0d.be Git - empathy.git/commitdiff
Make ca-certs location configurable (#634197)
authorBrian Pepple <bpepple@fedoraproject.org>
Sat, 6 Nov 2010 22:31:32 +0000 (18:31 -0400)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 15 Nov 2010 14:33:49 +0000 (15:33 +0100)
configure.ac
libempathy/empathy-tls-verifier.c

index b2336892c897bb9597e6b98a91d18cb37febab74..d2f09df1b139a7ccc51816662436ce4721b5f5fd 100644 (file)
@@ -200,6 +200,38 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
 
 AM_GLIB_GNU_GETTEXT
 
+# -----------------------------------------------------------
+# Make CA certificates path configurable
+# Stolen from GIO's TLS
+# -----------------------------------------------------------
+AC_MSG_CHECKING([location of system Certificate Authority list])
+AC_ARG_WITH(ca-file,
+            [AC_HELP_STRING([--with-ca-file=@<:@path@:>@],
+                            [path to system Certificate Authority list])])
+if test "$with_ca_file" = "no"; then
+    AC_MSG_RESULT([disabled])
+else
+    if test -z "$with_ca_file"; then
+        for f in /etc/pki/tls/certs/ca-bundle.crt \
+                 /etc/ssl/certs/ca-certificates.crt; do
+            if test -f "$f"; then
+                with_ca_file="$f"
+            fi
+        done
+        if test -z "$with_ca_file"; then
+            AC_MSG_ERROR([could not find. Use --with-ca-file=path to set, or --without-ca-file to disable])
+        fi
+    fi
+
+    AC_MSG_RESULT($with_ca_file)
+    if ! test -f "$with_ca_file"; then
+        AC_MSG_ERROR([No such file '$with_ca_file'. Use --with-ca-file=path to set, or --without-ca-file to disable])
+    fi
+    GTLS_SYSTEM_CA_FILE="$with_ca_file"
+
+    AC_DEFINE_UNQUOTED([GTLS_SYSTEM_CA_FILE], ["$GTLS_SYSTEM_CA_FILE"], [path to system Certificate Authority list])
+fi
+
 # -----------------------------------------------------------
 # Connectivity integration
 # -----------------------------------------------------------
@@ -497,6 +529,7 @@ Configure summary:
        Compiler Flags..............:  ${CFLAGS} ${ERROR_CFLAGS}
        Prefix......................:  ${prefix}
        Coding style checks.........:  ${ENABLE_CODING_STYLE_CHECKS}
+       CA Cert Path................:  ${GTLS_SYSTEM_CA_FILE}
 
     Features:
        Spell checking (enchant)....:  ${have_enchant}
index 13727db17fa6b1672664f722188229dc36197676..ca1726144cd33c3f29b8bdabd8b18f3dadcd0701 100644 (file)
@@ -44,7 +44,7 @@ enum {
 };
 
 static const gchar* system_ca_paths[] = {
-  "/etc/ssl/certs/ca-certificates.crt",
+  GTLS_SYSTEM_CA_FILE,
   NULL,
 };