url: let the backend decide CURLOPT_SSL_CTX_ support
... to further remove specific TLS backend knowledge from url.c
This commit is contained in:
parent
7494f0f498
commit
4c2e40a488
14
lib/url.c
14
lib/url.c
@ -1959,24 +1959,26 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
|
|
||||||
data->set.ssl.verifyhost = (0 != arg)?TRUE:FALSE;
|
data->set.ssl.verifyhost = (0 != arg)?TRUE:FALSE;
|
||||||
break;
|
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:
|
case CURLOPT_SSL_CTX_FUNCTION:
|
||||||
|
#ifdef have_curlssl_ssl_ctx
|
||||||
/*
|
/*
|
||||||
* Set a SSL_CTX callback
|
* Set a SSL_CTX callback
|
||||||
*/
|
*/
|
||||||
data->set.ssl.fsslctx = va_arg(param, curl_ssl_ctx_callback);
|
data->set.ssl.fsslctx = va_arg(param, curl_ssl_ctx_callback);
|
||||||
|
#else
|
||||||
|
result = CURLE_NOT_BUILT_IN;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case CURLOPT_SSL_CTX_DATA:
|
case CURLOPT_SSL_CTX_DATA:
|
||||||
|
#ifdef have_curlssl_ssl_ctx
|
||||||
/*
|
/*
|
||||||
* Set a SSL_CTX callback parameter pointer
|
* Set a SSL_CTX callback parameter pointer
|
||||||
*/
|
*/
|
||||||
data->set.ssl.fsslctxp = va_arg(param, void *);
|
data->set.ssl.fsslctxp = va_arg(param, void *);
|
||||||
break;
|
#else
|
||||||
|
result = CURLE_NOT_BUILT_IN;
|
||||||
#endif
|
#endif
|
||||||
|
break;
|
||||||
case CURLOPT_CERTINFO:
|
case CURLOPT_CERTINFO:
|
||||||
#ifdef have_curlssl_certinfo
|
#ifdef have_curlssl_certinfo
|
||||||
data->set.ssl.certinfo = (0 != va_arg(param, long))?TRUE:FALSE;
|
data->set.ssl.certinfo = (0 != va_arg(param, long))?TRUE:FALSE;
|
||||||
|
@ -82,6 +82,9 @@ void Curl_ossl_md5sum(unsigned char *tmp, /* input */
|
|||||||
/* this backend supports CURLOPT_CERTINFO */
|
/* this backend supports CURLOPT_CERTINFO */
|
||||||
#define have_curlssl_certinfo 1
|
#define have_curlssl_certinfo 1
|
||||||
|
|
||||||
|
/* this backend suppots CURLOPT_SSL_CTX_* */
|
||||||
|
#define have_curlssl_ssl_ctx 1
|
||||||
|
|
||||||
/* API setup for OpenSSL */
|
/* API setup for OpenSSL */
|
||||||
#define curlssl_init Curl_ossl_init
|
#define curlssl_init Curl_ossl_init
|
||||||
#define curlssl_cleanup Curl_ossl_cleanup
|
#define curlssl_cleanup Curl_ossl_cleanup
|
||||||
|
Loading…
x
Reference in New Issue
Block a user