- check for curls bundled ca certs
authorMichael Wallner <mike@php.net>
Sun, 19 Nov 2006 14:34:23 +0000 (14:34 +0000)
committerMichael Wallner <mike@php.net>
Sun, 19 Nov 2006 14:34:23 +0000 (14:34 +0000)
config9.m4
http_request_api.c

index 8bedac7..c154ed0 100644 (file)
@@ -211,6 +211,21 @@ dnl ----
                        AC_MSG_RESULT([no])
                fi
                
+               AC_MSG_CHECKING([for bundled SSL CA info])
+               CURL_CAINFO=
+               for i in `$CURL_CONFIG --ca` "/etc/ssl/certs/ca-certificates.crt"; do
+                       if test -f "$i"; then
+                               CURL_CAINFO="$i"
+                               break
+                       fi
+               done
+               if test -z "$CURL_CAINFO"; then
+                       AC_MSG_RESULT([not found])
+               else
+                       AC_MSG_RESULT([$CURL_CAINFO])
+                       AC_DEFINE_UNQUOTED([HTTP_CURL_CAINFO], ["$CURL_CAINFO"], [path to bundled SSL CA info])
+               fi
+               
                PHP_ADD_INCLUDE($CURL_DIR/include)
                PHP_ADD_LIBRARY_WITH_PATH(curl, $CURL_DIR/$PHP_LIBDIR, HTTP_SHARED_LIBADD)
                PHP_EVAL_LIBLINE($CURL_LIBS, HTTP_SHARED_LIBADD)
index 4fddd30..62b66bd 100644 (file)
@@ -406,7 +406,11 @@ PHP_HTTP_API void _http_request_defaults(http_request *request)
                HTTP_CURL_OPT(CURLOPT_SSL_VERIFYPEER, 0L);
                HTTP_CURL_OPT(CURLOPT_SSL_VERIFYHOST, 0L);
                HTTP_CURL_OPT(CURLOPT_SSL_CIPHER_LIST, NULL);
+#ifdef HTTP_CURL_CAINFO
+               HTTP_CURL_OPT(CURLOPT_CAINFO, HTTP_CURL_CAINFO);
+#else
                HTTP_CURL_OPT(CURLOPT_CAINFO, NULL);
+#endif
                HTTP_CURL_OPT(CURLOPT_CAPATH, NULL);
                HTTP_CURL_OPT(CURLOPT_RANDOM_FILE, NULL);
                HTTP_CURL_OPT(CURLOPT_EGDSOCKET, NULL);