]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
url: let the backend decide CURLOPT_SSL_CTX_ support
authorDaniel Stenberg <daniel@haxx.se>
Sat, 13 Sep 2014 13:28:08 +0000 (15:28 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 13 Sep 2014 13:28:08 +0000 (15:28 +0200)
... to further remove specific TLS backend knowledge from url.c

lib/url.c
lib/vtls/openssl.h

index 3e90d4e30b0db0ae90d51f70214052e920d2686a..74eb7e49b91255470f2871b576f93b743ddf2e9e 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -1959,24 +1959,26 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
 
     data->set.ssl.verifyhost = (0 != arg)?TRUE:FALSE;
     break;
-#ifdef USE_SSLEAY
-    /* since these two options are only possible to use on an OpenSSL-
-       powered libcurl we #ifdef them on this condition so that libcurls
-       built against other SSL libs will return a proper error when trying
-       to set this option! */
   case CURLOPT_SSL_CTX_FUNCTION:
+#ifdef have_curlssl_ssl_ctx
     /*
      * Set a SSL_CTX callback
      */
     data->set.ssl.fsslctx = va_arg(param, curl_ssl_ctx_callback);
+#else
+    result = CURLE_NOT_BUILT_IN;
+#endif
     break;
   case CURLOPT_SSL_CTX_DATA:
+#ifdef have_curlssl_ssl_ctx
     /*
      * Set a SSL_CTX callback parameter pointer
      */
     data->set.ssl.fsslctxp = va_arg(param, void *);
-    break;
+#else
+    result = CURLE_NOT_BUILT_IN;
 #endif
+    break;
   case CURLOPT_CERTINFO:
 #ifdef have_curlssl_certinfo
     data->set.ssl.certinfo = (0 != va_arg(param, long))?TRUE:FALSE;
index e6f205170c665ffc0b1ae4133ce26adad413d646..9c2602f94aab11175d1bca8f5319551029886895 100644 (file)
@@ -82,6 +82,9 @@ void Curl_ossl_md5sum(unsigned char *tmp, /* input */
 /* this backend supports CURLOPT_CERTINFO */
 #define have_curlssl_certinfo 1
 
+/* this backend suppots CURLOPT_SSL_CTX_* */
+#define have_curlssl_ssl_ctx 1
+
 /* API setup for OpenSSL */
 #define curlssl_init Curl_ossl_init
 #define curlssl_cleanup Curl_ossl_cleanup