  
  /* The last 3 #include files should be in this order */
  #include "curl_printf.h"
-@@ -490,11 +493,32 @@ CURLcode Curl_init_userdefined(struct Curl_easy *data)
- 
-   /* This is our preferred CA cert bundle/path since install time */
+@@ -496,12 +499,33 @@ CURLcode Curl_init_userdefined(struct Curl_easy *data)
+    */
+   if(Curl_ssl_backend() != CURLSSLBACKEND_SCHANNEL) {
  #if defined(CURL_CA_BUNDLE)
 +#if defined(__MINGW32__)
-+  const size_t path_max = PATH_MAX;
-+  char relocated[path_max];
-+  get_dll_path(relocated, path_max);
-+  strip_n_suffix_folders(relocated, 1);
-+  strncat(relocated, "/", path_max);
-+  char *relative = get_relative_path(CURL_BINDIR, CURL_CA_BUNDLE);
-+  strncat(relocated, relative, path_max);
-+  simplify_path(relocated);
-+  result = Curl_setstropt(&set->str[STRING_SSL_CAFILE_ORIG], relocated);
++    const size_t path_max = PATH_MAX;
++    char relocated[path_max];
++    get_dll_path(relocated, path_max);
++    strip_n_suffix_folders(relocated, 1);
++    strncat(relocated, "/", path_max);
++    char *relative = get_relative_path(CURL_BINDIR, CURL_CA_BUNDLE);
++    strncat(relocated, relative, path_max);
++    simplify_path(relocated);
++    result = Curl_setstropt(&set->str[STRING_SSL_CAFILE_ORIG], relocated);
 +#else
-   result = Curl_setstropt(&set->str[STRING_SSL_CAFILE_ORIG], CURL_CA_BUNDLE);
--  if(result)
+     result = Curl_setstropt(&set->str[STRING_SSL_CAFILE_ORIG], CURL_CA_BUNDLE);
+-    if(result)
 +#endif /* defined(__MINGW32__) */
-+  if(result) {
++    if(result) {
 +#if defined(__MINGW32__)
++      free((void*)relative);
++#endif /* defined(__MINGW32__) */
+       return result;
++    }
+ 
++#if defined(__MINGW32__)
++    result = Curl_setstropt(&set->str[STRING_SSL_CAFILE_PROXY], relocated);
 +    free((void*)relative);
-+#endif /* defined(__MINGW32__) */
-     return result;
-+  }
- 
-+#if defined(__MINGW32__)
-+  result = Curl_setstropt(&set->str[STRING_SSL_CAFILE_PROXY], relocated);
-+  free((void*)relative);
 +#else
-   result = Curl_setstropt(&set->str[STRING_SSL_CAFILE_PROXY], CURL_CA_BUNDLE);
-+#endif
-   if(result)
-     return result;
+     result = Curl_setstropt(&set->str[STRING_SSL_CAFILE_PROXY],
+                             CURL_CA_BUNDLE);
++#endif
+     if(result)
+       return result;
  #endif
 -- 
-2.16.1.windows.4
+2.17.0.windows.1
 

 LIB_RCFILES = libcurl.rc
 
diff --git a/lib/curl_config.h.in b/lib/curl_config.h.in
index 0f2a80403..9bad51f8d 100644
--- a/lib/curl_config.h.in
+++ b/lib/curl_config.h.in
@@ -12,6 +12,9 @@
 /* Default SSL backend */
 #undef CURL_DEFAULT_SSL_BACKEND
 

+
+#endif /* PATHTOOLS_H */
diff --git a/lib/url.c b/lib/url.c
index 701f83ab3..be87f627f 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -119,6 +119,9 @@ bool curl_win32_idn_to_ascii(const char *in, char **out);
