- 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 8bedac7fec173d1f098ce9e709ed4acf7871160b..c154ed05b690a441332f1977ee2635a496cfd0f5 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 4fddd30b5ed52c82f64c13d9c1ebabf212c1165d..62b66bd56f2980557440bafc3ac2428c4bfa097f 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);