]> granicus.if.org Git - curl/commitdiff
vtls: provide curl_global_sslset() even in non-SSL builds
authorDaniel Stenberg <daniel@haxx.se>
Thu, 21 Sep 2017 21:30:48 +0000 (23:30 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 22 Sep 2017 10:09:13 +0000 (12:09 +0200)
... it just returns error:

Bug: https://github.com/curl/curl/commit/1328f69d53f2f2e937696ea954c480412b018451#commitcomment-24470367
Reported-by: Marcel Raad
Closes #1906

docs/libcurl/curl_global_sslset.3
include/curl/curl.h
lib/vtls/vtls.c

index b438f8ad0acb5c287ec6a98bab4c966377f7d6b1..cee84458f03c224e17a335693a00aa1ff5cc24ee 100644 (file)
@@ -85,10 +85,13 @@ support for choosing SSL backends at runtime.
 If this function returns CURLSSLSET_OK, the backend was successfully selected.
 
 If the chosen backend is unknown (or support for the chosed backend has not
-been compiled into libcurl), the function returns CURLSSLSET_UNKNOWN_BACKEND.
+been compiled into libcurl), the function returns \fICURLSSLSET_UNKNOWN_BACKEND\fP.
 
 If the backend had been configured previously, or if \fIcurl_global_init(3)\fP
-has already been called, the function returns CURLSSLSET_TOO_LATE.
+has already been called, the function returns \fICURLSSLSET_TOO_LATE\fP.
+
+If this libcurl was built completely without SSL support, with no backends at
+all, this function returns \fICURLSSLSET_NO_BACKENDS\fP.
 .SH "SEE ALSO"
 .BR curl_global_init "(3), "
 .BR libcurl "(3) "
index 8b153fef9b2254782d7e271b2732d534cd40842c..501e3d19b8c6db3a28052981a5bce0740d7fa87d 100644 (file)
@@ -2370,7 +2370,8 @@ typedef struct {
 typedef enum {
   CURLSSLSET_OK = 0,
   CURLSSLSET_UNKNOWN_BACKEND,
-  CURLSSLSET_TOO_LATE
+  CURLSSLSET_TOO_LATE,
+  CURLSSLSET_NO_BACKENDS /* libcurl was built without any SSL support */
 } CURLsslset;
 
 CURL_EXTERN CURLsslset curl_global_sslset(curl_sslbackend id, const char *name,
index 6e230ee226e61c730afe97bc53ab5a657dec2fe8..56eb7ebf16c1cb431981da99c26e71ec3ca5c03e 100644 (file)
@@ -1296,4 +1296,14 @@ CURLsslset curl_global_sslset(curl_sslbackend id, const char *name,
   return CURLSSLSET_UNKNOWN_BACKEND;
 }
 
-#endif /* USE_SSL */
+#else /* USE_SSL */
+CURLsslset curl_global_sslset(curl_sslbackend id, const char *name,
+                              const curl_ssl_backend ***avail)
+{
+  (void)id;
+  (void)name;
+  (void)avail;
+  return CURLSSLSET_NO_BACKENDS;
+}
+
+#endif /* !USE_SSL */